home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1988-08-02 | 23.3 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
You can browse this item here: Sample.p
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| ZX81 Sinclair BASIC (image/sinclairBASIC)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Mon Aug 1 23:56:01 1988, modified Mon Aug 1 23:56:01 1988, creator 'MPS ', type ASCII, 23248 bytes "Sample.p" , at 0x5b50 382 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 53 61 6d 70 6c 65 | 2e 70 00 00 00 00 00 00 |..Sample|.p......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 5a d0 00 | 00 01 7e 9f 1a ed d1 9f |.....Z..|..~.....|
|00000060| 1a ed d1 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 c3 46 00 00 |........|.....F..|
|00000080| 7b 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |{-------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |--------|-------.|
|000000d0| 23 0d 23 09 41 70 70 6c | 65 20 4d 61 63 69 6e 74 |#.#.Appl|e Macint|
|000000e0| 6f 73 68 20 44 65 76 65 | 6c 6f 70 65 72 20 54 65 |osh Deve|loper Te|
|000000f0| 63 68 6e 69 63 61 6c 20 | 53 75 70 70 6f 72 74 0d |chnical |Support.|
|00000100| 23 0d 23 09 4d 75 6c 74 | 69 46 69 6e 64 65 72 2d |#.#.Mult|iFinder-|
|00000110| 41 77 61 72 65 20 53 69 | 6d 70 6c 65 20 53 61 6d |Aware Si|mple Sam|
|00000120| 70 6c 65 20 41 70 70 6c | 69 63 61 74 69 6f 6e 0d |ple Appl|ication.|
|00000130| 23 0d 23 09 53 61 6d 70 | 6c 65 0d 23 0d 23 09 53 |#.#.Samp|le.#.#.S|
|00000140| 61 6d 70 6c 65 2e 70 09 | 2d 09 50 61 73 63 61 6c |ample.p.|-.Pascal|
|00000150| 20 53 6f 75 72 63 65 0d | 23 0d 23 09 43 6f 70 79 | Source.|#.#.Copy|
|00000160| 72 69 67 68 74 20 a9 20 | 31 39 38 38 20 41 70 70 |right . |1988 App|
|00000170| 6c 65 20 43 6f 6d 70 75 | 74 65 72 2c 20 49 6e 63 |le Compu|ter, Inc|
|00000180| 2e 0d 23 09 41 6c 6c 20 | 72 69 67 68 74 73 20 72 |..#.All |rights r|
|00000190| 65 73 65 72 76 65 64 2e | 0d 23 0d 23 09 56 65 72 |eserved.|.#.#.Ver|
|000001a0| 73 69 6f 6e 73 3a 09 31 | 2e 30 09 09 09 09 09 38 |sions:.1|.0.....8|
|000001b0| 2f 38 38 0d 23 0d 23 09 | 43 6f 6d 70 6f 6e 65 6e |/88.#.#.|Componen|
|000001c0| 74 73 3a 09 53 61 6d 70 | 6c 65 2e 70 09 09 09 41 |ts:.Samp|le.p...A|
|000001d0| 75 67 75 73 74 20 31 2c | 20 31 39 38 38 0d 23 09 |ugust 1,| 1988.#.|
|000001e0| 09 09 09 53 61 6d 70 6c | 65 2e 63 09 09 09 41 75 |...Sampl|e.c...Au|
|000001f0| 67 75 73 74 20 31 2c 20 | 31 39 38 38 0d 23 09 09 |gust 1, |1988.#..|
|00000200| 09 09 53 61 6d 70 6c 65 | 2e 72 09 09 09 41 75 67 |..Sample|.r...Aug|
|00000210| 75 73 74 20 31 2c 20 31 | 39 38 38 0d 23 09 09 09 |ust 1, 1|988.#...|
|00000220| 09 53 61 6d 70 6c 65 2e | 68 09 09 09 41 75 67 75 |.Sample.|h...Augu|
|00000230| 73 74 20 31 2c 20 31 39 | 38 38 0d 23 09 09 09 09 |st 1, 19|88.#....|
|00000240| 50 53 61 6d 70 6c 65 2e | 6d 61 6b 65 09 09 41 75 |PSample.|make..Au|
|00000250| 67 75 73 74 20 31 2c 20 | 31 39 38 38 0d 23 09 09 |gust 1, |1988.#..|
|00000260| 09 09 43 53 61 6d 70 6c | 65 2e 6d 61 6b 65 09 09 |..CSampl|e.make..|
|00000270| 41 75 67 75 73 74 20 31 | 2c 20 31 39 38 38 0d 23 |August 1|, 1988.#|
|00000280| 0d 23 09 53 61 6d 70 6c | 65 20 69 73 20 61 6e 20 |.#.Sampl|e is an |
|00000290| 65 78 61 6d 70 6c 65 20 | 61 70 70 6c 69 63 61 74 |example |applicat|
|000002a0| 69 6f 6e 20 74 68 61 74 | 20 64 65 6d 6f 6e 73 74 |ion that| demonst|
|000002b0| 72 61 74 65 73 20 68 6f | 77 20 74 6f 0d 23 09 69 |rates ho|w to.#.i|
|000002c0| 6e 69 74 69 61 6c 69 7a | 65 20 74 68 65 20 63 6f |nitializ|e the co|
|000002d0| 6d 6d 6f 6e 6c 79 20 75 | 73 65 64 20 74 6f 6f 6c |mmonly u|sed tool|
|000002e0| 62 6f 78 20 6d 61 6e 61 | 67 65 72 73 2c 20 6f 70 |box mana|gers, op|
|000002f0| 65 72 61 74 65 20 0d 23 | 09 73 75 63 63 65 73 73 |erate .#|.success|
|00000300| 66 75 6c 6c 79 20 75 6e | 64 65 72 20 4d 75 6c 74 |fully un|der Mult|
|00000310| 69 46 69 6e 64 65 72 2c | 20 68 61 6e 64 6c 65 20 |iFinder,| handle |
|00000320| 64 65 73 6b 20 61 63 63 | 65 73 73 6f 72 69 65 73 |desk acc|essories|
|00000330| 2c 20 0d 23 09 61 6e 64 | 20 63 72 65 61 74 65 2c |, .#.and| create,|
|00000340| 20 67 72 6f 77 2c 20 61 | 6e 64 20 7a 6f 6f 6d 20 | grow, a|nd zoom |
|00000350| 77 69 6e 64 6f 77 73 2e | 0d 23 0d 23 09 49 74 20 |windows.|.#.#.It |
|00000360| 64 6f 65 73 20 6e 6f 74 | 20 62 79 20 61 6e 79 20 |does not| by any |
|00000370| 6d 65 61 6e 73 20 64 65 | 6d 6f 6e 73 74 72 61 74 |means de|monstrat|
|00000380| 65 20 61 6c 6c 20 74 68 | 65 20 74 65 63 68 6e 69 |e all th|e techni|
|00000390| 71 75 65 73 20 0d 23 09 | 79 6f 75 20 6e 65 65 64 |ques .#.|you need|
|000003a0| 20 66 6f 72 20 61 20 6c | 61 72 67 65 20 61 70 70 | for a l|arge app|
|000003b0| 6c 69 63 61 74 69 6f 6e | 2e 20 49 6e 20 70 61 72 |lication|. In par|
|000003c0| 74 69 63 75 6c 61 72 2c | 20 53 61 6d 70 6c 65 20 |ticular,| Sample |
|000003d0| 0d 23 09 64 6f 65 73 20 | 6e 6f 74 20 63 6f 76 65 |.#.does |not cove|
|000003e0| 72 20 65 78 63 65 70 74 | 69 6f 6e 20 68 61 6e 64 |r except|ion hand|
|000003f0| 6c 69 6e 67 2c 20 6d 75 | 6c 74 69 70 6c 65 20 77 |ling, mu|ltiple w|
|00000400| 69 6e 64 6f 77 73 2f 64 | 6f 63 75 6d 65 6e 74 73 |indows/d|ocuments|
|00000410| 2c 20 0d 23 09 73 6f 70 | 68 69 73 74 69 63 61 74 |, .#.sop|histicat|
|00000420| 65 64 20 6d 65 6d 6f 72 | 79 20 6d 61 6e 61 67 65 |ed memor|y manage|
|00000430| 6d 65 6e 74 2c 20 70 72 | 69 6e 74 69 6e 67 2c 20 |ment, pr|inting, |
|00000440| 6f 72 20 75 6e 64 6f 2e | 20 41 6c 6c 20 6f 66 20 |or undo.| All of |
|00000450| 0d 23 09 74 68 65 73 65 | 20 61 72 65 20 76 69 74 |.#.these| are vit|
|00000460| 61 6c 20 70 61 72 74 73 | 20 6f 66 20 61 20 6e 6f |al parts| of a no|
|00000470| 72 6d 61 6c 20 66 75 6c | 6c 2d 73 69 7a 65 64 20 |rmal ful|l-sized |
|00000480| 61 70 70 6c 69 63 61 74 | 69 6f 6e 2e 0d 23 0d 23 |applicat|ion..#.#|
|00000490| 09 54 68 69 73 20 61 70 | 70 6c 69 63 61 74 69 6f |.This ap|plicatio|
|000004a0| 6e 20 69 73 20 61 6e 20 | 65 78 61 6d 70 6c 65 20 |n is an |example |
|000004b0| 6f 66 20 74 68 65 20 66 | 6f 72 6d 20 6f 66 20 61 |of the f|orm of a|
|000004c0| 20 4d 61 63 69 6e 74 6f | 73 68 20 0d 23 09 61 70 | Macinto|sh .#.ap|
|000004d0| 70 6c 69 63 61 74 69 6f | 6e 3b 20 69 74 20 69 73 |plicatio|n; it is|
|000004e0| 20 4e 4f 54 20 61 20 74 | 65 6d 70 6c 61 74 65 2e | NOT a t|emplate.|
|000004f0| 20 49 74 20 69 73 20 4e | 4f 54 20 69 6e 74 65 6e | It is N|OT inten|
|00000500| 64 65 64 20 74 6f 20 62 | 65 20 0d 23 09 75 73 65 |ded to b|e .#.use|
|00000510| 64 20 61 73 20 61 20 66 | 6f 75 6e 64 61 74 69 6f |d as a f|oundatio|
|00000520| 6e 20 66 6f 72 20 74 68 | 65 20 6e 65 78 74 20 77 |n for th|e next w|
|00000530| 6f 72 6c 64 2d 63 6c 61 | 73 73 2c 20 62 65 73 74 |orld-cla|ss, best|
|00000540| 2d 73 65 6c 6c 69 6e 67 | 2c 20 0d 23 09 36 30 30 |-selling|, .#.600|
|00000550| 4b 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 2e 20 41 |K applic|ation. A|
|00000560| 20 73 74 69 63 6b 20 66 | 69 67 75 72 65 20 64 72 | stick f|igure dr|
|00000570| 61 77 69 6e 67 20 6f 66 | 20 74 68 65 20 68 75 6d |awing of| the hum|
|00000580| 61 6e 20 62 6f 64 79 20 | 6d 61 79 20 0d 23 09 62 |an body |may .#.b|
|00000590| 65 20 61 20 67 6f 6f 64 | 20 65 78 61 6d 70 6c 65 |e a good| example|
|000005a0| 20 6f 66 20 74 68 65 20 | 66 6f 72 6d 20 66 6f 72 | of the |form for|
|000005b0| 20 61 20 70 61 69 6e 74 | 69 6e 67 2c 20 62 75 74 | a paint|ing, but|
|000005c0| 20 74 68 61 74 20 64 6f | 65 73 20 6e 6f 74 20 0d | that do|es not .|
|000005d0| 23 09 6d 65 61 6e 20 69 | 74 20 73 68 6f 75 6c 64 |#.mean i|t should|
|000005e0| 20 62 65 20 75 73 65 64 | 20 61 73 20 74 68 65 20 | be used| as the |
|000005f0| 62 61 73 69 73 20 66 6f | 72 20 74 68 65 20 6e 65 |basis fo|r the ne|
|00000600| 78 74 20 4d 6f 6e 61 20 | 4c 69 73 61 2e 0d 23 0d |xt Mona |Lisa..#.|
|00000610| 23 09 57 65 20 72 65 63 | 6f 6d 6d 65 6e 64 20 74 |#.We rec|ommend t|
|00000620| 68 61 74 20 79 6f 75 20 | 72 65 76 69 65 77 20 74 |hat you |review t|
|00000630| 68 69 73 20 70 72 6f 67 | 72 61 6d 20 6f 72 20 54 |his prog|ram or T|
|00000640| 45 53 61 6d 70 6c 65 20 | 62 65 66 6f 72 65 20 0d |ESample |before .|
|00000650| 23 09 62 65 67 69 6e 6e | 69 6e 67 20 61 20 6e 65 |#.beginn|ing a ne|
|00000660| 77 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 2e 0d 23 |w applic|ation..#|
|00000670| 0d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.-------|--------|
|00000680| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000690| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000006a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000006b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 7d |--------|-------}|
|000006c0| 0d 0d 0d 50 52 4f 47 52 | 41 4d 20 53 61 6d 70 6c |...PROGR|AM Sampl|
|000006d0| 65 3b 0d 0d 0d 7b 53 65 | 67 6d 65 6e 74 61 74 69 |e;...{Se|gmentati|
|000006e0| 6f 6e 20 73 74 72 61 74 | 65 67 79 3a 0d 0d 20 54 |on strat|egy:.. T|
|000006f0| 68 69 73 20 70 72 6f 67 | 72 61 6d 20 63 6f 6e 73 |his prog|ram cons|
|00000700| 69 73 74 73 20 6f 66 20 | 74 68 72 65 65 20 73 65 |ists of |three se|
|00000710| 67 6d 65 6e 74 73 2e 20 | 4d 61 69 6e 20 63 6f 6e |gments. |Main con|
|00000720| 74 61 69 6e 73 20 6d 6f | 73 74 20 6f 66 20 74 68 |tains mo|st of th|
|00000730| 65 20 63 6f 64 65 2c 0d | 20 69 6e 63 6c 75 64 69 |e code,.| includi|
|00000740| 6e 67 20 74 68 65 20 4d | 50 57 20 6c 69 62 72 61 |ng the M|PW libra|
|00000750| 72 69 65 73 2c 20 61 6e | 64 20 74 68 65 20 6d 61 |ries, an|d the ma|
|00000760| 69 6e 20 70 72 6f 67 72 | 61 6d 2e 20 49 6e 69 74 |in progr|am. Init|
|00000770| 69 61 6c 69 7a 65 20 63 | 6f 6e 74 61 69 6e 73 0d |ialize c|ontains.|
|00000780| 20 63 6f 64 65 20 74 68 | 61 74 20 69 73 20 6f 6e | code th|at is on|
|00000790| 6c 79 20 75 73 65 64 20 | 6f 6e 63 65 2c 20 64 75 |ly used |once, du|
|000007a0| 72 69 6e 67 20 73 74 61 | 72 74 75 70 2c 20 61 6e |ring sta|rtup, an|
|000007b0| 64 20 63 61 6e 20 62 65 | 20 75 6e 6c 6f 61 64 65 |d can be| unloade|
|000007c0| 64 20 61 66 74 65 72 20 | 74 68 65 0d 20 70 72 6f |d after |the. pro|
|000007d0| 67 72 61 6d 20 73 74 61 | 72 74 73 2e 20 25 41 35 |gram sta|rts. %A5|
|000007e0| 49 6e 69 74 20 69 73 20 | 61 75 74 6f 6d 61 74 69 |Init is |automati|
|000007f0| 63 61 6c 6c 79 20 63 72 | 65 61 74 65 64 20 62 79 |cally cr|eated by|
|00000800| 20 74 68 65 20 4c 69 6e | 6b 65 72 20 74 6f 20 69 | the Lin|ker to i|
|00000810| 6e 69 74 69 61 6c 69 7a | 65 0d 20 67 6c 6f 62 61 |nitializ|e. globa|
|00000820| 6c 73 20 66 6f 72 20 74 | 68 65 20 4d 50 57 20 6c |ls for t|he MPW l|
|00000830| 69 62 72 61 72 69 65 73 | 20 61 6e 64 20 69 73 20 |ibraries| and is |
|00000840| 75 6e 6c 6f 61 64 65 64 | 20 72 69 67 68 74 20 61 |unloaded| right a|
|00000850| 77 61 79 2e 7d 0d 0d 0d | 7b 53 65 74 50 6f 72 74 |way.}...|{SetPort|
|00000860| 20 73 74 72 61 74 65 67 | 79 3a 0d 0d 20 54 6f 6f | strateg|y:.. Too|
|00000870| 6c 62 6f 78 20 72 6f 75 | 74 69 6e 65 73 20 64 6f |lbox rou|tines do|
|00000880| 20 6e 6f 74 20 63 68 61 | 6e 67 65 20 74 68 65 20 | not cha|nge the |
|00000890| 63 75 72 72 65 6e 74 20 | 70 6f 72 74 2e 20 49 6e |current |port. In|
|000008a0| 20 73 70 69 74 65 20 6f | 66 20 74 68 69 73 2c 20 | spite o|f this, |
|000008b0| 69 6e 20 74 68 69 73 0d | 20 70 72 6f 67 72 61 6d |in this.| program|
|000008c0| 20 77 65 20 75 73 65 20 | 61 20 73 74 72 61 74 65 | we use |a strate|
|000008d0| 67 79 20 6f 66 20 63 61 | 6c 6c 69 6e 67 20 53 65 |gy of ca|lling Se|
|000008e0| 74 50 6f 72 74 20 77 68 | 65 6e 65 76 65 72 20 77 |tPort wh|enever w|
|000008f0| 65 20 77 61 6e 74 20 74 | 6f 20 64 72 61 77 20 6f |e want t|o draw o|
|00000900| 72 0d 20 6d 61 6b 65 20 | 63 61 6c 6c 73 20 77 68 |r. make |calls wh|
|00000910| 69 63 68 20 64 65 70 65 | 6e 64 20 6f 6e 20 74 68 |ich depe|nd on th|
|00000920| 65 20 63 75 72 72 65 6e | 74 20 70 6f 72 74 2e 20 |e curren|t port. |
|00000930| 54 68 69 73 20 6d 61 6b | 65 73 20 75 73 20 6c 65 |This mak|es us le|
|00000940| 73 73 20 76 75 6c 6e 65 | 72 61 62 6c 65 0d 20 74 |ss vulne|rable. t|
|00000950| 6f 20 62 75 67 73 20 69 | 6e 20 6f 74 68 65 72 20 |o bugs i|n other |
|00000960| 73 6f 66 74 77 61 72 65 | 20 77 68 69 63 68 20 6d |software| which m|
|00000970| 69 67 68 74 20 61 6c 74 | 65 72 20 74 68 65 20 63 |ight alt|er the c|
|00000980| 75 72 72 65 6e 74 20 70 | 6f 72 74 20 28 73 75 63 |urrent p|ort (suc|
|00000990| 68 20 61 73 20 74 68 65 | 0d 20 62 75 67 20 28 66 |h as the|. bug (f|
|000009a0| 65 61 74 75 72 65 3f 29 | 20 69 6e 20 6d 61 6e 79 |eature?)| in many|
|000009b0| 20 64 65 73 6b 20 61 63 | 63 65 73 73 6f 72 69 65 | desk ac|cessorie|
|000009c0| 73 20 77 68 69 63 68 20 | 63 68 61 6e 67 65 20 74 |s which |change t|
|000009d0| 68 65 20 70 6f 72 74 20 | 6f 6e 20 4f 70 65 6e 44 |he port |on OpenD|
|000009e0| 65 73 6b 41 63 63 29 2e | 0d 20 48 6f 70 65 66 75 |eskAcc).|. Hopefu|
|000009f0| 6c 6c 79 2c 20 74 68 69 | 73 20 61 6c 73 6f 20 6d |lly, thi|s also m|
|00000a00| 61 6b 65 73 20 74 68 65 | 20 72 6f 75 74 69 6e 65 |akes the| routine|
|00000a10| 73 20 66 72 6f 6d 20 74 | 68 69 73 20 70 72 6f 67 |s from t|his prog|
|00000a20| 72 61 6d 20 6d 6f 72 65 | 20 73 65 6c 66 2d 63 6f |ram more| self-co|
|00000a30| 6e 74 61 69 6e 65 64 2c | 0d 20 73 69 6e 63 65 20 |ntained,|. since |
|00000a40| 74 68 65 79 20 64 6f 6e | 27 74 20 64 65 70 65 6e |they don|'t depen|
|00000a50| 64 20 6f 6e 20 74 68 65 | 20 63 75 72 72 65 6e 74 |d on the| current|
|00000a60| 20 70 6f 72 74 20 73 65 | 74 74 69 6e 67 2e 7d 0d | port se|tting.}.|
|00000a70| 0d 0d 55 53 45 53 0d 09 | 4d 65 6d 54 79 70 65 73 |..USES..|MemTypes|
|00000a80| 2c 20 51 75 69 63 6b 44 | 72 61 77 2c 20 4f 53 49 |, QuickD|raw, OSI|
|00000a90| 6e 74 66 2c 20 54 6f 6f | 6c 49 6e 74 66 3b 0d 0d |ntf, Too|lIntf;..|
|00000aa0| 43 4f 4e 53 54 0d 09 7b | 4d 50 57 20 33 2e 30 20 |CONST..{|MPW 3.0 |
|00000ab0| 77 69 6c 6c 20 69 6e 63 | 6c 75 64 65 20 61 20 54 |will inc|lude a T|
|00000ac0| 72 61 70 73 2e 70 20 69 | 6e 74 65 72 66 61 63 65 |raps.p i|nterface|
|00000ad0| 20 66 69 6c 65 20 74 68 | 61 74 20 69 6e 63 6c 75 | file th|at inclu|
|00000ae0| 64 65 73 20 63 6f 6e 73 | 74 61 6e 74 73 20 66 6f |des cons|tants fo|
|00000af0| 72 20 74 72 61 70 20 6e | 75 6d 62 65 72 73 2e 0d |r trap n|umbers..|
|00000b00| 09 20 54 68 65 73 65 20 | 63 6f 6e 73 74 61 6e 74 |. These |constant|
|00000b10| 73 20 61 72 65 20 66 72 | 6f 6d 20 74 68 61 74 20 |s are fr|om that |
|00000b20| 66 69 6c 65 2e 7d 0d 09 | 5f 57 61 69 74 4e 65 78 |file.}..|_WaitNex|
|00000b30| 74 45 76 65 6e 74 09 09 | 09 3d 20 24 41 38 36 30 |tEvent..|.= $A860|
|00000b40| 3b 0d 09 5f 55 6e 69 6d | 70 6c 65 6d 65 6e 74 65 |;.._Unim|plemente|
|00000b50| 64 09 09 09 3d 20 24 41 | 38 39 46 3b 0d 0d 09 7b |d...= $A|89F;...{|
|00000b60| 53 79 73 45 6e 76 69 72 | 6f 6e 73 56 65 72 73 69 |SysEnvir|onsVersi|
|00000b70| 6f 6e 20 69 73 20 70 61 | 73 73 65 64 20 74 6f 20 |on is pa|ssed to |
|00000b80| 53 79 73 45 6e 76 69 72 | 6f 6e 73 20 74 6f 20 74 |SysEnvir|ons to t|
|00000b90| 65 6c 6c 20 69 74 20 77 | 68 69 63 68 20 76 65 72 |ell it w|hich ver|
|00000ba0| 73 69 6f 6e 20 6f 66 20 | 74 68 65 0d 09 20 53 79 |sion of |the.. Sy|
|00000bb0| 73 45 6e 76 52 65 63 20 | 77 65 20 75 6e 64 65 72 |sEnvRec |we under|
|00000bc0| 73 74 61 6e 64 2e 7d 0d | 09 73 79 73 45 6e 76 69 |stand.}.|.sysEnvi|
|00000bd0| 72 6f 6e 73 56 65 72 73 | 69 6f 6e 09 09 3d 20 31 |ronsVers|ion..= 1|
|00000be0| 3b 0d 0d 09 7b 4f 53 45 | 76 65 6e 74 20 69 73 20 |;...{OSE|vent is |
|00000bf0| 74 68 65 20 65 76 65 6e | 74 20 6e 75 6d 62 65 72 |the even|t number|
|00000c00| 20 6f 66 20 74 68 65 20 | 73 75 73 70 65 6e 64 2f | of the |suspend/|
|00000c10| 72 65 73 75 6d 65 20 61 | 6e 64 20 6d 6f 75 73 65 |resume a|nd mouse|
|00000c20| 2d 6d 6f 76 65 64 20 65 | 76 65 6e 74 73 20 73 65 |-moved e|vents se|
|00000c30| 6e 74 0d 09 20 62 79 20 | 4d 75 6c 74 69 46 69 6e |nt.. by |MultiFin|
|00000c40| 64 65 72 2e 20 4f 6e 63 | 65 20 77 65 20 64 65 74 |der. Onc|e we det|
|00000c50| 65 72 6d 69 6e 65 20 74 | 68 61 74 20 61 6e 20 65 |ermine t|hat an e|
|00000c60| 76 65 6e 74 20 69 73 20 | 61 6e 20 6f 73 45 76 65 |vent is |an osEve|
|00000c70| 6e 74 2c 20 77 65 20 6c | 6f 6f 6b 20 61 74 20 74 |nt, we l|ook at t|
|00000c80| 68 65 0d 09 20 68 69 67 | 68 20 62 79 74 65 20 6f |he.. hig|h byte o|
|00000c90| 66 20 74 68 65 20 6d 65 | 73 73 61 67 65 20 73 65 |f the me|ssage se|
|00000ca0| 6e 74 20 74 6f 20 64 65 | 74 65 72 6d 69 6e 65 20 |nt to de|termine |
|00000cb0| 77 68 69 63 68 20 6b 69 | 6e 64 20 69 74 20 69 73 |which ki|nd it is|
|00000cc0| 2e 20 54 6f 20 64 69 66 | 66 65 72 65 6e 74 69 61 |. To dif|ferentia|
|00000cd0| 74 65 0d 09 20 73 75 73 | 70 65 6e 64 20 61 6e 64 |te.. sus|pend and|
|00000ce0| 20 72 65 73 75 6d 65 20 | 65 76 65 6e 74 73 20 77 | resume |events w|
|00000cf0| 65 20 63 68 65 63 6b 20 | 74 68 65 20 72 65 73 75 |e check |the resu|
|00000d00| 6d 65 4d 61 73 6b 20 62 | 69 74 2e 7d 0d 09 6f 73 |meMask b|it.}..os|
|00000d10| 45 76 65 6e 74 09 09 09 | 09 09 3d 20 61 70 70 34 |Event...|..= app4|
|00000d20| 45 76 74 3b 09 7b 65 76 | 65 6e 74 20 75 73 65 64 |Evt;.{ev|ent used|
|00000d30| 20 62 79 20 4d 75 6c 74 | 69 46 69 6e 64 65 72 7d | by Mult|iFinder}|
|00000d40| 0d 09 73 75 73 70 65 6e | 64 52 65 73 75 6d 65 4d |..suspen|dResumeM|
|00000d50| 65 73 73 61 67 65 09 3d | 20 31 3b 09 09 7b 68 69 |essage.=| 1;..{hi|
|00000d60| 67 68 20 62 79 74 65 20 | 6f 66 20 73 75 73 70 65 |gh byte |of suspe|
|00000d70| 6e 64 2f 72 65 73 75 6d | 65 20 65 76 65 6e 74 20 |nd/resum|e event |
|00000d80| 6d 65 73 73 61 67 65 7d | 0d 09 72 65 73 75 6d 65 |message}|..resume|
|00000d90| 4d 61 73 6b 09 09 09 09 | 3d 20 31 3b 09 09 7b 62 |Mask....|= 1;..{b|
|00000da0| 69 74 20 6f 66 20 6d 65 | 73 73 61 67 65 20 66 69 |it of me|ssage fi|
|00000db0| 65 6c 64 20 66 6f 72 20 | 72 65 73 75 6d 65 20 76 |eld for |resume v|
|00000dc0| 73 2e 20 73 75 73 70 65 | 6e 64 7d 0d 09 6d 6f 75 |s. suspe|nd}..mou|
|00000dd0| 73 65 4d 6f 76 65 64 4d | 65 73 73 61 67 65 09 09 |seMovedM|essage..|
|00000de0| 3d 20 24 46 41 3b 09 09 | 7b 68 69 67 68 20 62 79 |= $FA;..|{high by|
|00000df0| 74 65 20 6f 66 20 6d 6f | 75 73 65 2d 6d 6f 76 65 |te of mo|use-move|
|00000e00| 64 20 65 76 65 6e 74 20 | 6d 65 73 73 61 67 65 7d |d event |message}|
|00000e10| 0d 0d 09 7b 54 68 69 73 | 20 69 73 20 74 68 65 20 |...{This| is the |
|00000e20| 6d 69 6e 69 6d 75 6d 20 | 73 69 7a 65 20 28 69 6e |minimum |size (in|
|00000e30| 20 4b 29 20 66 6f 72 20 | 74 68 65 20 61 70 70 6c | K) for |the appl|
|00000e40| 69 63 61 74 69 6f 6e 20 | 74 6f 20 72 75 6e 2e 7d |ication |to run.}|
|00000e50| 0d 09 6b 4d 69 6e 53 69 | 7a 65 09 3d 20 32 32 3b |..kMinSi|ze.= 22;|
|00000e60| 0d 09 0d 09 7b 45 78 74 | 72 65 6d 65 4e 65 67 20 |....{Ext|remeNeg |
|00000e70| 61 6e 64 20 45 78 74 72 | 65 6d 65 50 6f 73 20 61 |and Extr|emePos a|
|00000e80| 72 65 20 75 73 65 64 20 | 74 6f 20 73 65 74 20 75 |re used |to set u|
|00000e90| 70 20 77 69 64 65 20 6f | 70 65 6e 20 72 65 63 74 |p wide o|pen rect|
|00000ea0| 61 6e 67 6c 65 73 20 61 | 6e 64 20 72 65 67 69 6f |angles a|nd regio|
|00000eb0| 6e 73 2e 7d 0d 09 65 78 | 74 72 65 6d 65 4e 65 67 |ns.}..ex|tremeNeg|
|00000ec0| 09 3d 20 2d 33 32 37 36 | 38 3b 0d 09 65 78 74 72 |.= -3276|8;..extr|
|00000ed0| 65 6d 65 50 6f 73 09 3d | 20 33 32 37 36 37 20 2d |emePos.=| 32767 -|
|00000ee0| 20 31 3b 09 09 09 7b 72 | 65 71 75 69 72 65 64 20 | 1;...{r|equired |
|00000ef0| 66 6f 72 20 6f 6c 64 20 | 72 65 67 69 6f 6e 20 62 |for old |region b|
|00000f00| 75 67 7d 0d 09 0d 09 7b | 54 68 65 20 66 6f 6c 6c |ug}....{|The foll|
|00000f10| 6f 77 69 6e 67 20 63 6f | 6e 73 74 61 6e 74 73 20 |owing co|nstants |
|00000f20| 61 72 65 20 61 6c 6c 20 | 72 65 73 6f 75 72 63 65 |are all |resource|
|00000f30| 20 49 44 73 2c 20 63 6f | 72 72 65 73 70 6f 6e 64 | IDs, co|rrespond|
|00000f40| 69 6e 67 20 74 6f 20 72 | 65 73 6f 75 72 63 65 73 |ing to r|esources|
|00000f50| 20 69 6e 20 53 61 6d 70 | 6c 65 2e 72 2e 7d 0d 09 | in Samp|le.r.}..|
|00000f60| 72 4d 65 6e 75 42 61 72 | 09 3d 20 31 32 38 3b 09 |rMenuBar|.= 128;.|
|00000f70| 09 09 09 09 7b 61 70 70 | 6c 69 63 61 74 69 6f 6e |....{app|lication|
|00000f80| 27 73 20 6d 65 6e 75 20 | 62 61 72 7d 0d 09 72 41 |'s menu |bar}..rA|
|00000f90| 62 6f 75 74 41 6c 65 72 | 74 09 3d 20 31 32 38 3b |boutAler|t.= 128;|
|00000fa0| 09 09 09 09 09 7b 61 62 | 6f 75 74 20 61 6c 65 72 |.....{ab|out aler|
|00000fb0| 74 7d 0d 09 72 57 69 6e | 64 6f 77 09 09 3d 20 31 |t}..rWin|dow..= 1|
|00000fc0| 32 38 3b 09 09 09 09 09 | 7b 61 70 70 6c 69 63 61 |28;.....|{applica|
|00000fd0| 74 69 6f 6e 27 73 20 77 | 69 6e 64 6f 77 7d 0d 09 |tion's w|indow}..|
|00000fe0| 72 53 74 6f 70 52 65 63 | 74 09 3d 20 31 32 38 3b |rStopRec|t.= 128;|
|00000ff0| 09 09 09 09 09 7b 72 65 | 63 74 61 6e 67 6c 65 20 |.....{re|ctangle |
|00001000| 66 6f 72 20 53 74 6f 70 | 20 6c 69 67 68 74 7d 0d |for Stop| light}.|
|00001010| 09 72 47 6f 52 65 63 74 | 09 09 3d 20 31 32 39 3b |.rGoRect|..= 129;|
|00001020| 09 09 09 09 09 7b 72 65 | 63 74 61 6e 67 6c 65 20 |.....{re|ctangle |
|00001030| 66 6f 72 20 47 6f 20 6c | 69 67 68 74 7d 0d 0d 09 |for Go l|ight}...|
|00001040| 7b 54 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 63 |{The fol|lowing c|
|00001050| 6f 6e 73 74 61 6e 74 73 | 20 61 72 65 20 75 73 65 |onstants| are use|
|00001060| 64 20 74 6f 20 69 64 65 | 6e 74 69 66 79 20 6d 65 |d to ide|ntify me|
|00001070| 6e 75 73 20 61 6e 64 20 | 74 68 65 69 72 20 69 74 |nus and |their it|
|00001080| 65 6d 73 2e 20 54 68 65 | 20 6d 65 6e 75 20 49 44 |ems. The| menu ID|
|00001090| 73 0d 09 20 68 61 76 65 | 20 61 6e 20 22 6d 22 20 |s.. have| an "m" |
|000010a0| 70 72 65 66 69 78 20 61 | 6e 64 20 74 68 65 20 69 |prefix a|nd the i|
|000010b0| 74 65 6d 20 6e 75 6d 62 | 65 72 73 20 77 69 74 68 |tem numb|ers with|
|000010c0| 69 6e 20 65 61 63 68 20 | 6d 65 6e 75 20 68 61 76 |in each |menu hav|
|000010d0| 65 20 61 6e 20 22 69 22 | 20 70 72 65 66 69 78 2e |e an "i"| prefix.|
|000010e0| 7d 0d 09 6d 41 70 70 6c | 65 09 09 3d 20 31 32 38 |}..mAppl|e..= 128|
|000010f0| 3b 09 09 09 09 09 7b 41 | 70 70 6c 65 20 6d 65 6e |;.....{A|pple men|
|00001100| 75 7d 0d 09 69 41 62 6f | 75 74 09 09 3d 20 31 3b |u}..iAbo|ut..= 1;|
|00001110| 0d 0d 09 6d 46 69 6c 65 | 09 09 3d 20 31 32 39 3b |...mFile|..= 129;|
|00001120| 09 09 09 09 09 7b 46 69 | 6c 65 20 6d 65 6e 75 7d |.....{Fi|le menu}|
|00001130| 0d 09 69 4e 65 77 09 09 | 3d 20 31 3b 0d 09 69 43 |..iNew..|= 1;..iC|
|00001140| 6c 6f 73 65 09 09 3d 20 | 34 3b 0d 09 69 51 75 69 |lose..= |4;..iQui|
|00001150| 74 09 09 3d 20 31 32 3b | 0d 0d 09 6d 45 64 69 74 |t..= 12;|...mEdit|
|00001160| 09 09 3d 20 31 33 30 3b | 09 09 09 09 09 7b 45 64 |..= 130;|.....{Ed|
|00001170| 69 74 20 6d 65 6e 75 7d | 0d 09 69 55 6e 64 6f 09 |it menu}|..iUndo.|
|00001180| 09 3d 20 31 3b 0d 09 69 | 43 75 74 09 09 3d 20 33 |.= 1;..i|Cut..= 3|
|00001190| 3b 0d 09 69 43 6f 70 79 | 09 09 3d 20 34 3b 0d 09 |;..iCopy|..= 4;..|
|000011a0| 69 50 61 73 74 65 09 09 | 3d 20 35 3b 0d 09 69 43 |iPaste..|= 5;..iC|
|000011b0| 6c 65 61 72 09 09 3d 20 | 36 3b 0d 0d 09 6d 4c 69 |lear..= |6;...mLi|
|000011c0| 67 68 74 09 09 3d 20 31 | 33 31 3b 09 09 09 09 09 |ght..= 1|31;.....|
|000011d0| 7b 4c 69 67 68 74 20 6d | 65 6e 75 7d 0d 09 69 53 |{Light m|enu}..iS|
|000011e0| 74 6f 70 09 09 3d 20 31 | 3b 0d 09 69 47 6f 09 09 |top..= 1|;..iGo..|
|000011f0| 09 3d 20 32 3b 0d 0d 0d | 56 41 52 0d 09 7b 54 68 |.= 2;...|VAR..{Th|
|00001200| 65 20 22 67 22 20 70 72 | 65 66 69 78 20 69 73 20 |e "g" pr|efix is |
|00001210| 75 73 65 64 20 74 6f 20 | 65 6d 70 68 61 73 69 7a |used to |emphasiz|
|00001220| 65 20 74 68 61 74 20 61 | 20 76 61 72 69 61 62 6c |e that a| variabl|
|00001230| 65 20 69 73 20 67 6c 6f | 62 61 6c 2e 7d 0d 0d 09 |e is glo|bal.}...|
|00001240| 7b 47 4d 61 63 20 69 73 | 20 75 73 65 64 20 74 6f |{GMac is| used to|
|00001250| 20 68 6f 6c 64 20 74 68 | 65 20 72 65 73 75 6c 74 | hold th|e result|
|00001260| 20 6f 66 20 61 20 53 79 | 73 45 6e 76 69 72 6f 6e | of a Sy|sEnviron|
|00001270| 73 20 63 61 6c 6c 2e 20 | 54 68 69 73 20 6d 61 6b |s call. |This mak|
|00001280| 65 73 0d 09 20 69 74 20 | 63 6f 6e 76 65 6e 69 65 |es.. it |convenie|
|00001290| 6e 74 20 66 6f 72 20 61 | 6e 79 20 72 6f 75 74 69 |nt for a|ny routi|
|000012a0| 6e 65 20 74 6f 20 63 68 | 65 63 6b 20 74 68 65 20 |ne to ch|eck the |
|000012b0| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 2e 7d 0d 09 67 |environm|ent.}..g|
|000012c0| 4d 61 63 09 09 09 09 3a | 20 53 79 73 45 6e 76 52 |Mac....:| SysEnvR|
|000012d0| 65 63 3b 09 7b 73 65 74 | 20 75 70 20 62 79 20 49 |ec;.{set| up by I|
|000012e0| 6e 69 74 69 61 6c 69 7a | 65 7d 0d 0d 09 7b 47 48 |nitializ|e}...{GH|
|000012f0| 61 73 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 20 |asWaitNe|xtEvent |
|00001300| 69 73 20 73 65 74 20 61 | 74 20 73 74 61 72 74 75 |is set a|t startu|
|00001310| 70 2c 20 61 6e 64 20 74 | 65 6c 6c 73 20 77 68 65 |p, and t|ells whe|
|00001320| 74 68 65 72 20 74 68 65 | 20 57 61 69 74 4e 65 78 |ther the| WaitNex|
|00001330| 74 45 76 65 6e 74 0d 09 | 20 74 72 61 70 20 69 73 |tEvent..| trap is|
|00001340| 20 61 76 61 69 6c 61 62 | 6c 65 2e 20 49 66 20 69 | availab|le. If i|
|00001350| 74 20 69 73 20 66 61 6c | 73 65 2c 20 77 65 20 6b |t is fal|se, we k|
|00001360| 6e 6f 77 20 74 68 61 74 | 20 77 65 20 6d 75 73 74 |now that| we must|
|00001370| 20 63 61 6c 6c 20 47 65 | 74 4e 65 78 74 45 76 65 | call Ge|tNextEve|
|00001380| 6e 74 2e 7d 0d 09 67 48 | 61 73 57 61 69 74 4e 65 |nt.}..gH|asWaitNe|
|00001390| 78 74 45 76 65 6e 74 09 | 3a 20 42 4f 4f 4c 45 41 |xtEvent.|: BOOLEA|
|000013a0| 4e 3b 09 09 7b 73 65 74 | 20 75 70 20 62 79 20 49 |N;..{set| up by I|
|000013b0| 6e 69 74 69 61 6c 69 7a | 65 7d 0d 0d 09 7b 47 49 |nitializ|e}...{GI|
|000013c0| 6e 42 61 63 6b 67 72 6f | 75 6e 64 20 69 73 20 6d |nBackgro|und is m|
|000013d0| 61 69 6e 74 61 69 6e 65 | 64 20 62 79 20 6f 75 72 |aintaine|d by our|
|000013e0| 20 6f 73 45 76 65 6e 74 | 20 68 61 6e 64 6c 69 6e | osEvent| handlin|
|000013f0| 67 20 72 6f 75 74 69 6e | 65 73 2e 20 41 6e 79 20 |g routin|es. Any |
|00001400| 70 61 72 74 20 6f 66 0d | 09 20 74 68 65 20 70 72 |part of.|. the pr|
|00001410| 6f 67 72 61 6d 20 63 61 | 6e 20 63 68 65 63 6b 20 |ogram ca|n check |
|00001420| 69 74 20 74 6f 20 66 69 | 6e 64 20 6f 75 74 20 69 |it to fi|nd out i|
|00001430| 66 20 69 74 20 69 73 20 | 63 75 72 72 65 6e 74 6c |f it is |currentl|
|00001440| 79 20 69 6e 20 74 68 65 | 20 62 61 63 6b 67 72 6f |y in the| backgro|
|00001450| 75 6e 64 2e 7d 0d 09 67 | 49 6e 42 61 63 6b 67 72 |und.}..g|InBackgr|
|00001460| 6f 75 6e 64 09 09 3a 20 | 42 4f 4f 4c 45 41 4e 3b |ound..: |BOOLEAN;|
|00001470| 09 09 7b 6d 61 69 6e 74 | 61 69 6e 65 64 20 62 79 |..{maint|ained by|
|00001480| 20 49 6e 69 74 69 61 6c | 69 7a 65 20 61 6e 64 20 | Initial|ize and |
|00001490| 44 6f 45 76 65 6e 74 7d | 0d 0d 09 7b 47 47 72 6f |DoEvent}|...{GGro|
|000014a0| 77 52 65 63 74 20 69 73 | 20 61 20 72 65 63 74 61 |wRect is| a recta|
|000014b0| 6e 67 6c 65 20 72 65 70 | 72 65 73 65 6e 74 69 6e |ngle rep|resentin|
|000014c0| 67 20 74 68 65 20 67 72 | 6f 77 2f 73 68 72 69 6e |g the gr|ow/shrin|
|000014d0| 6b 20 6c 69 6d 69 74 73 | 20 66 6f 72 20 47 72 6f |k limits| for Gro|
|000014e0| 77 57 69 6e 64 6f 77 2e | 7d 0d 09 67 47 72 6f 77 |wWindow.|}..gGrow|
|000014f0| 52 65 63 74 09 09 09 3a | 20 52 65 63 74 3b 09 09 |Rect...:| Rect;..|
|00001500| 09 7b 73 65 74 20 75 70 | 20 62 79 20 49 6e 69 74 |.{set up| by Init|
|00001510| 69 61 6c 69 7a 65 7d 0d | 0d 0d 09 7b 54 68 65 20 |ialize}.|...{The |
|00001520| 66 6f 6c 6c 6f 77 69 6e | 67 20 67 6c 6f 62 61 6c |followin|g global|
|00001530| 73 20 61 72 65 20 74 68 | 65 20 73 74 61 74 65 20 |s are th|e state |
|00001540| 6f 66 20 74 68 65 20 77 | 69 6e 64 6f 77 2e 20 49 |of the w|indow. I|
|00001550| 66 20 77 65 20 73 75 70 | 70 6f 72 74 65 64 20 6d |f we sup|ported m|
|00001560| 6f 72 65 20 74 68 61 6e | 0d 09 20 6f 6e 65 20 77 |ore than|.. one w|
|00001570| 69 6e 64 6f 77 2c 20 74 | 68 65 79 20 77 6f 75 6c |indow, t|hey woul|
|00001580| 64 20 62 65 20 61 74 74 | 61 74 63 68 65 64 20 74 |d be att|atched t|
|00001590| 6f 20 65 61 63 68 20 64 | 6f 63 75 6d 65 6e 74 2c |o each d|ocument,|
|000015a0| 20 72 61 74 68 65 72 20 | 74 68 61 6e 20 67 6c 6f | rather |than glo|
|000015b0| 62 61 6c 73 2e 7d 0d 0d | 09 7b 47 53 74 6f 70 70 |bals.}..|.{GStopp|
|000015c0| 65 64 20 74 65 6c 6c 73 | 20 77 68 65 74 68 65 72 |ed tells| whether|
|000015d0| 20 74 68 65 20 73 74 6f | 70 20 6c 69 67 68 74 20 | the sto|p light |
|000015e0| 69 73 20 63 75 72 72 65 | 6e 74 6c 79 20 6f 6e 20 |is curre|ntly on |
|000015f0| 73 74 6f 70 20 6f 72 20 | 67 6f 2e 7d 0d 09 67 53 |stop or |go.}..gS|
|00001600| 74 6f 70 70 65 64 09 09 | 09 3a 20 42 4f 4f 4c 45 |topped..|.: BOOLE|
|00001610| 41 4e 3b 09 09 7b 6d 61 | 69 6e 74 61 69 6e 65 64 |AN;..{ma|intained|
|00001620| 20 62 79 20 49 6e 69 74 | 69 61 6c 69 7a 65 20 61 | by Init|ialize a|
|00001630| 6e 64 20 53 65 74 4c 69 | 67 68 74 7d 0d 0d 09 7b |nd SetLi|ght}...{|
|00001640| 47 53 74 6f 70 52 65 63 | 74 20 61 6e 64 20 67 47 |GStopRec|t and gG|
|00001650| 6f 52 65 63 74 20 61 72 | 65 20 74 68 65 20 72 65 |oRect ar|e the re|
|00001660| 63 74 61 6e 67 6c 65 73 | 20 6f 66 20 74 68 65 20 |ctangles| of the |
|00001670| 74 77 6f 20 73 74 6f 70 | 20 6c 69 67 68 74 73 20 |two stop| lights |
|00001680| 69 6e 20 74 68 65 20 77 | 69 6e 64 6f 77 2e 7d 0d |in the w|indow.}.|
|00001690| 09 67 53 74 6f 70 52 65 | 63 74 09 09 09 3a 20 52 |.gStopRe|ct...: R|
|000016a0| 65 63 74 3b 09 09 09 7b | 73 65 74 20 75 70 20 62 |ect;...{|set up b|
|000016b0| 79 20 49 6e 69 74 69 61 | 6c 69 7a 65 7d 0d 09 67 |y Initia|lize}..g|
|000016c0| 47 6f 52 65 63 74 09 09 | 09 09 3a 20 52 65 63 74 |GoRect..|..: Rect|
|000016d0| 3b 09 09 09 7b 73 65 74 | 20 75 70 20 62 79 20 49 |;...{set| up by I|
|000016e0| 6e 69 74 69 61 6c 69 7a | 65 7d 0d 0d 0d 7b 24 53 |nitializ|e}...{$S|
|000016f0| 20 49 6e 69 74 69 61 6c | 69 7a 65 7d 0d 46 55 4e | Initial|ize}.FUN|
|00001700| 43 54 49 4f 4e 20 54 72 | 61 70 41 76 61 69 6c 61 |CTION Tr|apAvaila|
|00001710| 62 6c 65 28 74 4e 75 6d | 62 65 72 3a 20 49 4e 54 |ble(tNum|ber: INT|
|00001720| 45 47 45 52 3b 20 74 54 | 79 70 65 3a 20 54 72 61 |EGER; tT|ype: Tra|
|00001730| 70 54 79 70 65 29 3a 20 | 42 4f 4f 4c 45 41 4e 3b |pType): |BOOLEAN;|
|00001740| 0d 0d 7b 43 68 65 63 6b | 20 74 6f 20 73 65 65 20 |..{Check| to see |
|00001750| 69 66 20 61 20 67 69 76 | 65 6e 20 74 72 61 70 20 |if a giv|en trap |
|00001760| 69 73 20 69 6d 70 6c 65 | 6d 65 6e 74 65 64 2e 20 |is imple|mented. |
|00001770| 54 68 69 73 20 69 73 20 | 6f 6e 6c 79 20 75 73 65 |This is |only use|
|00001780| 64 20 62 79 20 74 68 65 | 0d 20 49 6e 69 74 69 61 |d by the|. Initia|
|00001790| 6c 69 7a 65 20 72 6f 75 | 74 69 6e 65 20 69 6e 20 |lize rou|tine in |
|000017a0| 74 68 69 73 20 70 72 6f | 67 72 61 6d 2c 20 73 6f |this pro|gram, so|
|000017b0| 20 77 65 20 70 75 74 20 | 69 74 20 69 6e 20 74 68 | we put |it in th|
|000017c0| 65 20 49 6e 69 74 69 61 | 6c 69 7a 65 20 73 65 67 |e Initia|lize seg|
|000017d0| 6d 65 6e 74 2e 0d 20 54 | 68 65 20 72 65 63 6f 6d |ment.. T|he recom|
|000017e0| 6d 65 6e 64 65 64 20 61 | 70 70 72 6f 61 63 68 20 |mended a|pproach |
|000017f0| 74 6f 20 73 65 65 20 69 | 66 20 61 20 74 72 61 70 |to see i|f a trap|
|00001800| 20 69 73 20 69 6d 70 6c | 65 6d 65 6e 74 65 64 20 | is impl|emented |
|00001810| 69 73 20 74 6f 20 73 65 | 65 20 69 66 0d 20 74 68 |is to se|e if. th|
|00001820| 65 20 61 64 64 72 65 73 | 73 20 6f 66 20 74 68 65 |e addres|s of the|
|00001830| 20 74 72 61 70 20 72 6f | 75 74 69 6e 65 20 69 73 | trap ro|utine is|
|00001840| 20 74 68 65 20 73 61 6d | 65 20 61 73 20 74 68 65 | the sam|e as the|
|00001850| 20 61 64 64 72 65 73 73 | 20 6f 66 20 74 68 65 0d | address| of the.|
|00001860| 20 55 6e 69 6d 70 6c 65 | 6d 65 6e 74 65 64 20 74 | Unimple|mented t|
|00001870| 72 61 70 2e 7d 0d 0d 42 | 45 47 49 4e 0d 09 7b 43 |rap.}..B|EGIN..{C|
|00001880| 68 65 63 6b 20 61 6e 64 | 20 73 65 65 20 69 66 20 |heck and| see if |
|00001890| 74 68 65 20 74 72 61 70 | 20 65 78 69 73 74 73 2e |the trap| exists.|
|000018a0| 20 4f 6e 20 36 34 4b 20 | 52 4f 4d 20 6d 61 63 68 | On 64K |ROM mach|
|000018b0| 69 6e 65 73 2c 20 74 54 | 79 70 65 20 77 69 6c 6c |ines, tT|ype will|
|000018c0| 20 62 65 20 69 67 6e 6f | 72 65 64 2e 7d 0d 0d 09 | be igno|red.}...|
|000018d0| 54 72 61 70 41 76 61 69 | 6c 61 62 6c 65 20 3a 3d |TrapAvai|lable :=|
|000018e0| 20 4e 47 65 74 54 72 61 | 70 41 64 64 72 65 73 73 | NGetTra|pAddress|
|000018f0| 28 74 4e 75 6d 62 65 72 | 2c 20 74 54 79 70 65 29 |(tNumber|, tType)|
|00001900| 20 3c 3e 20 47 65 74 54 | 72 61 70 41 64 64 72 65 | <> GetT|rapAddre|
|00001910| 73 73 28 5f 55 6e 69 6d | 70 6c 65 6d 65 6e 74 65 |ss(_Unim|plemente|
|00001920| 64 29 3b 0d 45 4e 44 3b | 20 7b 54 72 61 70 41 76 |d);.END;| {TrapAv|
|00001930| 61 69 6c 61 62 6c 65 7d | 0d 0d 0d 7b 24 53 20 4d |ailable}|...{$S M|
|00001940| 61 69 6e 7d 0d 46 55 4e | 43 54 49 4f 4e 20 49 73 |ain}.FUN|CTION Is|
|00001950| 44 41 57 69 6e 64 6f 77 | 28 77 69 6e 64 6f 77 3a |DAWindow|(window:|
|00001960| 20 57 69 6e 64 6f 77 50 | 74 72 29 3a 20 42 4f 4f | WindowP|tr): BOO|
|00001970| 4c 45 41 4e 3b 0d 0d 7b | 43 68 65 63 6b 20 69 66 |LEAN;..{|Check if|
|00001980| 20 61 20 77 69 6e 64 6f | 77 20 62 65 6c 6f 6e 67 | a windo|w belong|
|00001990| 73 20 74 6f 20 61 20 64 | 65 73 6b 20 61 63 63 65 |s to a d|esk acce|
|000019a0| 73 73 6f 72 79 2e 7d 0d | 0d 42 45 47 49 4e 0d 09 |ssory.}.|.BEGIN..|
|000019b0| 49 46 20 77 69 6e 64 6f | 77 20 3d 20 4e 49 4c 20 |IF windo|w = NIL |
|000019c0| 54 48 45 4e 0d 09 09 49 | 73 44 41 57 69 6e 64 6f |THEN...I|sDAWindo|
|000019d0| 77 20 3a 3d 20 46 41 4c | 53 45 0d 09 45 4c 53 45 |w := FAL|SE..ELSE|
|000019e0| 09 7b 44 41 20 77 69 6e | 64 6f 77 73 20 68 61 76 |.{DA win|dows hav|
|000019f0| 65 20 6e 65 67 61 74 69 | 76 65 20 77 69 6e 64 6f |e negati|ve windo|
|00001a00| 77 4b 69 6e 64 73 7d 0d | 09 09 49 73 44 41 57 69 |wKinds}.|..IsDAWi|
|00001a10| 6e 64 6f 77 20 3a 3d 20 | 57 69 6e 64 6f 77 50 65 |ndow := |WindowPe|
|00001a20| 65 6b 28 77 69 6e 64 6f | 77 29 5e 2e 77 69 6e 64 |ek(windo|w)^.wind|
|00001a30| 6f 77 4b 69 6e 64 20 3c | 20 30 3b 0d 45 4e 44 3b |owKind <| 0;.END;|
|00001a40| 20 7b 49 73 44 41 57 69 | 6e 64 6f 77 7d 0d 0d 0d | {IsDAWi|ndow}...|
|00001a50| 7b 24 53 20 4d 61 69 6e | 7d 0d 46 55 4e 43 54 49 |{$S Main|}.FUNCTI|
|00001a60| 4f 4e 20 49 73 41 70 70 | 57 69 6e 64 6f 77 28 77 |ON IsApp|Window(w|
|00001a70| 69 6e 64 6f 77 3a 20 57 | 69 6e 64 6f 77 50 74 72 |indow: W|indowPtr|
|00001a80| 29 3a 20 42 4f 4f 4c 45 | 41 4e 3b 0d 0d 7b 43 68 |): BOOLE|AN;..{Ch|
|00001a90| 65 63 6b 20 74 6f 20 73 | 65 65 20 69 66 20 61 20 |eck to s|ee if a |
|00001aa0| 77 69 6e 64 6f 77 20 62 | 65 6c 6f 6e 67 73 20 74 |window b|elongs t|
|00001ab0| 6f 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |o the ap|plicatio|
|00001ac0| 6e 2e 20 49 66 20 74 68 | 65 20 77 69 6e 64 6f 77 |n. If th|e window|
|00001ad0| 20 70 6f 69 6e 74 65 72 | 0d 20 70 61 73 73 65 64 | pointer|. passed|
|00001ae0| 20 77 61 73 20 4e 49 4c | 2c 20 74 68 65 6e 20 69 | was NIL|, then i|
|00001af0| 74 20 63 6f 75 6c 64 20 | 6e 6f 74 20 62 65 20 61 |t could |not be a|
|00001b00| 6e 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 77 69 |n applic|ation wi|
|00001b10| 6e 64 6f 77 2e 20 57 69 | 6e 64 6f 77 4b 69 6e 64 |ndow. Wi|ndowKind|
|00001b20| 73 0d 20 74 68 61 74 20 | 61 72 65 20 6e 65 67 61 |s. that |are nega|
|00001b30| 74 69 76 65 20 62 65 6c | 6f 6e 67 20 74 6f 20 74 |tive bel|ong to t|
|00001b40| 68 65 20 73 79 73 74 65 | 6d 20 61 6e 64 20 77 69 |he syste|m and wi|
|00001b50| 6e 64 6f 77 4b 69 6e 64 | 73 20 6c 65 73 73 20 74 |ndowKind|s less t|
|00001b60| 68 61 6e 20 75 73 65 72 | 4b 69 6e 64 0d 20 61 72 |han user|Kind. ar|
|00001b70| 65 20 72 65 73 65 72 76 | 65 64 20 62 79 20 41 70 |e reserv|ed by Ap|
|00001b80| 70 6c 65 20 65 78 63 65 | 70 74 20 66 6f 72 20 77 |ple exce|pt for w|
|00001b90| 69 6e 64 6f 77 4b 69 6e | 64 73 20 65 71 75 61 6c |indowKin|ds equal|
|00001ba0| 20 74 6f 20 64 69 61 6c | 6f 67 4b 69 6e 64 2c 20 | to dial|ogKind, |
|00001bb0| 77 68 69 63 68 0d 20 6d | 65 61 6e 20 69 74 20 69 |which. m|ean it i|
|00001bc0| 73 20 61 20 64 69 61 6c | 6f 67 2e 7d 0d 0d 42 45 |s a dial|og.}..BE|
|00001bd0| 47 49 4e 0d 09 49 46 20 | 77 69 6e 64 6f 77 20 3d |GIN..IF |window =|
|00001be0| 20 4e 49 4c 20 54 48 45 | 4e 0d 09 09 49 73 41 70 | NIL THE|N...IsAp|
|00001bf0| 70 57 69 6e 64 6f 77 20 | 3a 3d 20 46 41 4c 53 45 |pWindow |:= FALSE|
|00001c00| 0d 09 45 4c 53 45 09 7b | 61 70 70 6c 69 63 61 74 |..ELSE.{|applicat|
|00001c10| 69 6f 6e 20 77 69 6e 64 | 6f 77 73 20 68 61 76 65 |ion wind|ows have|
|00001c20| 20 77 69 6e 64 6f 77 4b | 69 6e 64 73 20 3e 3d 20 | windowK|inds >= |
|00001c30| 75 73 65 72 4b 69 6e 64 | 20 28 38 29 20 6f 72 20 |userKind| (8) or |
|00001c40| 64 69 61 6c 6f 67 4b 69 | 6e 64 20 28 32 29 7d 0d |dialogKi|nd (2)}.|
|00001c50| 09 09 57 49 54 48 20 57 | 69 6e 64 6f 77 50 65 65 |..WITH W|indowPee|
|00001c60| 6b 28 77 69 6e 64 6f 77 | 29 5e 20 44 4f 0d 09 09 |k(window|)^ DO...|
|00001c70| 09 49 73 41 70 70 57 69 | 6e 64 6f 77 20 3a 3d 20 |.IsAppWi|ndow := |
|00001c80| 28 77 69 6e 64 6f 77 4b | 69 6e 64 20 3e 3d 20 75 |(windowK|ind >= u|
|00001c90| 73 65 72 4b 69 6e 64 29 | 20 7c 20 28 77 69 6e 64 |serKind)| | (wind|
|00001ca0| 6f 77 4b 69 6e 64 20 3d | 20 64 69 61 6c 6f 67 4b |owKind =| dialogK|
|00001cb0| 69 6e 64 29 3b 0d 45 4e | 44 3b 20 7b 49 73 41 70 |ind);.EN|D; {IsAp|
|00001cc0| 70 57 69 6e 64 6f 77 7d | 0d 0d 0d 7b 24 53 20 4d |pWindow}|...{$S M|
|00001cd0| 61 69 6e 7d 0d 50 52 4f | 43 45 44 55 52 45 20 44 |ain}.PRO|CEDURE D|
|00001ce0| 6f 43 6c 6f 73 65 57 69 | 6e 64 6f 77 28 77 69 6e |oCloseWi|ndow(win|
|00001cf0| 64 6f 77 3a 20 57 69 6e | 64 6f 77 50 74 72 29 3b |dow: Win|dowPtr);|
|00001d00| 0d 0d 7b 43 6c 6f 73 65 | 20 61 20 77 69 6e 64 6f |..{Close| a windo|
|00001d10| 77 2e 20 54 68 69 73 20 | 68 61 6e 64 6c 65 73 20 |w. This |handles |
|00001d20| 6f 6e 6c 79 20 64 65 73 | 6b 20 61 63 63 65 73 73 |only des|k access|
|00001d30| 6f 72 79 20 77 69 6e 64 | 6f 77 73 20 62 65 63 61 |ory wind|ows beca|
|00001d40| 75 73 65 20 77 65 20 64 | 6f 20 6e 6f 74 0d 20 61 |use we d|o not. a|
|00001d50| 6c 6c 6f 77 20 6f 75 72 | 20 77 69 6e 64 6f 77 20 |llow our| window |
|00001d60| 74 6f 20 62 65 20 63 6c | 6f 73 65 64 2e 20 54 45 |to be cl|osed. TE|
|00001d70| 53 61 6d 70 6c 65 20 70 | 72 6f 76 69 64 65 73 20 |Sample p|rovides |
|00001d80| 61 6e 20 65 78 61 6d 70 | 6c 65 20 6f 66 20 68 6f |an examp|le of ho|
|00001d90| 77 20 74 6f 20 68 61 6e | 64 6c 65 0d 20 74 68 65 |w to han|dle. the|
|00001da0| 20 63 6c 6f 73 69 6e 67 | 20 6f 66 20 61 70 70 6c | closing| of appl|
|00001db0| 69 63 61 74 69 6f 6e 20 | 77 69 6e 64 6f 77 73 2e |ication |windows.|
|00001dc0| 7d 0d 0d 42 45 47 49 4e | 0d 09 49 46 20 49 73 44 |}..BEGIN|..IF IsD|
|00001dd0| 41 57 69 6e 64 6f 77 28 | 77 69 6e 64 6f 77 29 20 |AWindow(|window) |
|00001de0| 54 48 45 4e 0d 09 09 43 | 6c 6f 73 65 44 65 73 6b |THEN...C|loseDesk|
|00001df0| 41 63 63 28 57 69 6e 64 | 6f 77 50 65 65 6b 28 77 |Acc(Wind|owPeek(w|
|00001e00| 69 6e 64 6f 77 29 5e 2e | 77 69 6e 64 6f 77 4b 69 |indow)^.|windowKi|
|00001e10| 6e 64 29 3b 0d 45 4e 44 | 3b 20 7b 44 6f 43 6c 6f |nd);.END|; {DoClo|
|00001e20| 73 65 57 69 6e 64 6f 77 | 7d 0d 0d 0d 7b 24 53 20 |seWindow|}...{$S |
|00001e30| 4d 61 69 6e 7d 0d 50 52 | 4f 43 45 44 55 52 45 20 |Main}.PR|OCEDURE |
|00001e40| 46 6f 72 63 65 45 6e 76 | 69 72 6f 6e 73 3b 0d 0d |ForceEnv|irons;..|
|00001e50| 7b 4d 61 6b 65 20 73 75 | 72 65 20 74 68 61 74 20 |{Make su|re that |
|00001e60| 74 68 65 20 6d 61 63 68 | 69 6e 65 20 68 61 73 20 |the mach|ine has |
|00001e70| 61 74 20 6c 65 61 73 74 | 20 31 32 38 4b 20 52 4f |at least| 128K RO|
|00001e80| 4d 73 20 61 6e 64 20 65 | 6e 6f 75 67 68 20 6d 65 |Ms and e|nough me|
|00001e90| 6d 6f 72 79 20 74 6f 20 | 72 75 6e 2e 0d 20 49 66 |mory to |run.. If|
|00001ea0| 20 69 74 20 64 6f 65 73 | 6e 27 74 2c 20 65 78 69 | it does|n't, exi|
|00001eb0| 74 2e 20 53 79 73 45 6e | 76 69 72 6f 6e 73 20 63 |t. SysEn|virons c|
|00001ec0| 61 6e 20 62 65 20 63 61 | 6c 6c 65 64 20 62 65 66 |an be ca|lled bef|
|00001ed0| 6f 72 65 20 74 68 65 20 | 74 6f 6f 6c 62 6f 78 20 |ore the |toolbox |
|00001ee0| 6d 61 6e 61 67 65 72 73 | 0d 20 61 72 65 20 69 6e |managers|. are in|
|00001ef0| 69 74 69 61 6c 69 7a 65 | 64 2c 20 61 6e 64 20 77 |itialize|d, and w|
|00001f00| 65 20 6e 65 65 64 20 74 | 6f 20 63 61 6c 6c 20 69 |e need t|o call i|
|00001f10| 74 20 61 74 20 74 68 69 | 73 20 70 6f 69 6e 74 20 |t at thi|s point |
|00001f20| 73 6f 20 77 65 20 63 61 | 6e 20 63 68 65 63 6b 20 |so we ca|n check |
|00001f30| 66 6f 72 0d 20 74 68 65 | 20 72 69 67 68 74 20 52 |for. the| right R|
|00001f40| 4f 4d 73 20 61 6e 64 20 | 6d 65 6d 6f 72 79 20 61 |OMs and |memory a|
|00001f50| 76 61 69 6c 61 62 69 6c | 69 74 79 20 62 65 66 6f |vailabil|ity befo|
|00001f60| 72 65 20 77 65 20 63 61 | 6c 6c 20 4d 61 78 41 70 |re we ca|ll MaxAp|
|00001f70| 70 6c 5a 6f 6e 65 20 61 | 6e 64 0d 20 69 6e 69 74 |plZone a|nd. init|
|00001f80| 69 61 6c 69 7a 65 20 74 | 68 65 20 74 6f 6f 6c 62 |ialize t|he toolb|
|00001f90| 6f 78 20 6d 61 6e 61 67 | 65 72 73 2e 20 49 66 20 |ox manag|ers. If |
|00001fa0| 41 70 70 6c 65 54 61 6c | 6b 20 68 61 73 20 6e 6f |AppleTal|k has no|
|00001fb0| 74 20 62 65 65 6e 20 69 | 6e 69 74 69 61 6c 69 7a |t been i|nitializ|
|00001fc0| 65 64 2c 20 79 6f 75 0d | 20 77 6f 6e 27 74 20 67 |ed, you.| won't g|
|00001fd0| 65 74 20 74 68 65 20 76 | 65 72 73 69 6f 6e 20 6f |et the v|ersion o|
|00001fe0| 66 20 74 68 65 20 41 70 | 70 6c 65 54 61 6c 6b 20 |f the Ap|pleTalk |
|00001ff0| 64 72 69 76 65 72 20 74 | 68 61 74 20 69 73 20 72 |driver t|hat is r|
|00002000| 75 6e 6e 69 6e 67 2e 20 | 54 68 61 74 20 69 73 20 |unning. |That is |
|00002010| 6e 6f 74 0d 20 63 72 69 | 74 69 63 61 6c 20 68 65 |not. cri|tical he|
|00002020| 72 65 2c 20 61 6e 64 20 | 69 66 20 74 68 61 74 20 |re, and |if that |
|00002030| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 77 61 73 20 |informat|ion was |
|00002040| 72 65 71 75 69 72 65 64 | 2c 20 53 79 73 45 6e 76 |required|, SysEnv|
|00002050| 69 72 6f 6e 73 20 63 6f | 75 6c 64 20 62 65 0d 20 |irons co|uld be. |
|00002060| 63 61 6c 6c 65 64 20 61 | 67 61 69 6e 20 61 66 74 |called a|gain aft|
|00002070| 65 72 20 41 70 70 6c 65 | 54 61 6c 6b 20 68 61 64 |er Apple|Talk had|
|00002080| 20 62 65 65 6e 20 69 6e | 69 74 69 61 6c 69 7a 65 | been in|itialize|
|00002090| 64 2e 7d 0d 0d 56 41 52 | 0d 09 69 67 6e 6f 72 65 |d.}..VAR|..ignore|
|000020a0| 45 72 72 6f 72 09 3a 20 | 4f 53 45 72 72 3b 0d 42 |Error.: |OSErr;.B|
|000020b0| 45 47 49 4e 0d 09 7b 69 | 67 6e 6f 72 65 20 74 68 |EGIN..{i|gnore th|
|000020c0| 65 20 65 72 72 6f 72 20 | 72 65 74 75 72 6e 65 64 |e error |returned|
|000020d0| 20 66 72 6f 6d 20 53 79 | 73 45 6e 76 69 72 6f 6e | from Sy|sEnviron|
|000020e0| 73 3b 20 65 76 65 6e 20 | 69 66 20 61 6e 20 65 72 |s; even |if an er|
|000020f0| 72 6f 72 20 6f 63 63 75 | 72 72 65 64 2c 0d 09 20 |ror occu|rred,.. |
|00002100| 74 68 65 20 53 79 73 45 | 6e 76 69 72 6f 6e 73 20 |the SysE|nvirons |
|00002110| 67 6c 75 65 20 77 69 6c | 6c 20 66 69 6c 6c 20 69 |glue wil|l fill i|
|00002120| 6e 20 74 68 65 20 53 79 | 73 45 6e 76 52 65 63 7d |n the Sy|sEnvRec}|
|00002130| 0d 09 69 67 6e 6f 72 65 | 45 72 72 6f 72 20 3a 3d |..ignore|Error :=|
|00002140| 20 53 79 73 45 6e 76 69 | 72 6f 6e 73 28 73 79 73 | SysEnvi|rons(sys|
|00002150| 45 6e 76 69 72 6f 6e 73 | 56 65 72 73 69 6f 6e 2c |Environs|Version,|
|00002160| 20 67 4d 61 63 29 3b 0d | 09 49 46 20 28 67 4d 61 | gMac);.|.IF (gMa|
|00002170| 63 2e 6d 61 63 68 69 6e | 65 54 79 70 65 20 3c 20 |c.machin|eType < |
|00002180| 30 29 20 7c 0d 09 09 28 | 53 74 61 63 6b 53 70 61 |0) |...(|StackSpa|
|00002190| 63 65 20 2b 20 4f 52 44 | 28 47 65 74 41 70 70 6c |ce + ORD|(GetAppl|
|000021a0| 4c 69 6d 69 74 29 20 2d | 20 4f 52 44 28 41 70 70 |Limit) -| ORD(App|
|000021b0| 6c 69 63 5a 6f 6e 65 29 | 20 3c 20 6b 4d 69 6e 53 |licZone)| < kMinS|
|000021c0| 69 7a 65 20 2a 20 31 30 | 32 34 29 20 54 48 45 4e |ize * 10|24) THEN|
|000021d0| 0d 09 09 45 78 69 74 54 | 6f 53 68 65 6c 6c 3b 0d |...ExitT|oShell;.|
|000021e0| 09 7b 69 66 20 79 6f 75 | 20 68 61 76 65 20 73 74 |.{if you| have st|
|000021f0| 61 63 6b 20 72 65 71 75 | 69 72 65 6d 65 6e 74 73 |ack requ|irements|
|00002200| 20 74 68 61 74 20 64 69 | 66 66 65 72 20 66 72 6f | that di|ffer fro|
|00002210| 6d 20 74 68 65 20 64 65 | 66 61 75 6c 74 2c 0d 09 |m the de|fault,..|
|00002220| 74 68 65 6e 20 79 6f 75 | 20 63 6f 75 6c 64 20 75 |then you| could u|
|00002230| 73 65 20 53 65 74 41 70 | 70 6c 4c 69 6d 69 74 20 |se SetAp|plLimit |
|00002240| 74 6f 20 69 6e 63 72 65 | 61 73 65 20 53 74 61 63 |to incre|ase Stac|
|00002250| 6b 53 70 61 63 65 20 61 | 74 20 74 68 69 73 20 70 |kSpace a|t this p|
|00002260| 6f 69 6e 74 2e 7d 0d 45 | 4e 44 3b 20 7b 46 6f 72 |oint.}.E|ND; {For|
|00002270| 63 65 45 6e 76 69 72 6f | 6e 73 7d 0d 0d 0d 7b 24 |ceEnviro|ns}...{$|
|00002280| 53 20 49 6e 69 74 69 61 | 6c 69 7a 65 7d 0d 50 52 |S Initia|lize}.PR|
|00002290| 4f 43 45 44 55 52 45 20 | 47 6f 47 65 74 52 65 63 |OCEDURE |GoGetRec|
|000022a0| 74 28 72 65 63 74 49 44 | 3a 20 49 4e 54 45 47 45 |t(rectID|: INTEGE|
|000022b0| 52 3b 20 56 41 52 20 74 | 68 65 52 65 63 74 3a 20 |R; VAR t|heRect: |
|000022c0| 52 65 63 74 29 3b 0d 0d | 7b 54 68 69 73 20 75 74 |Rect);..|{This ut|
|000022d0| 69 6c 69 74 79 20 6c 6f | 61 64 73 20 74 68 65 20 |ility lo|ads the |
|000022e0| 67 6c 6f 62 61 6c 20 72 | 65 63 74 61 6e 67 6c 65 |global r|ectangle|
|000022f0| 73 20 74 68 61 74 20 61 | 72 65 20 75 73 65 64 20 |s that a|re used |
|00002300| 62 79 20 74 68 65 20 77 | 69 6e 64 6f 77 0d 20 64 |by the w|indow. d|
|00002310| 72 61 77 69 6e 67 20 72 | 6f 75 74 69 6e 65 73 2e |rawing r|outines.|
|00002320| 20 49 74 20 73 68 6f 77 | 73 20 68 6f 77 20 74 68 | It show|s how th|
|00002330| 65 20 72 65 73 6f 75 72 | 63 65 20 6d 61 6e 61 67 |e resour|ce manag|
|00002340| 65 72 20 63 61 6e 20 62 | 65 20 75 73 65 64 20 74 |er can b|e used t|
|00002350| 6f 20 68 6f 6c 64 0d 20 | 76 61 6c 75 65 73 20 69 |o hold. |values i|
|00002360| 6e 20 61 20 63 6f 6e 76 | 65 6e 69 65 6e 74 20 6d |n a conv|enient m|
|00002370| 61 6e 6e 65 72 2e 20 54 | 68 65 73 65 20 76 61 6c |anner. T|hese val|
|00002380| 75 65 73 20 61 72 65 20 | 74 68 65 6e 20 65 61 73 |ues are |then eas|
|00002390| 69 6c 79 20 61 6c 74 65 | 72 65 64 20 77 69 74 68 |ily alte|red with|
|000023a0| 6f 75 74 0d 20 68 61 76 | 69 6e 67 20 74 6f 20 72 |out. hav|ing to r|
|000023b0| 65 2d 63 6f 6d 70 69 6c | 65 20 74 68 65 20 73 6f |e-compil|e the so|
|000023c0| 75 72 63 65 20 63 6f 64 | 65 2e 20 49 6e 20 74 68 |urce cod|e. In th|
|000023d0| 69 73 20 70 61 72 74 69 | 63 75 6c 61 72 20 63 61 |is parti|cular ca|
|000023e0| 73 65 2c 20 77 65 20 6b | 6e 6f 77 0d 20 74 68 61 |se, we k|now. tha|
|000023f0| 74 20 74 68 69 73 20 72 | 6f 75 74 69 6e 65 20 69 |t this r|outine i|
|00002400| 73 20 62 65 69 6e 67 20 | 63 61 6c 6c 65 64 20 61 |s being |called a|
|00002410| 74 20 69 6e 69 74 69 61 | 6c 69 7a 61 74 69 6f 6e |t initia|lization|
|00002420| 20 74 69 6d 65 2e 20 54 | 68 65 72 65 66 6f 72 65 | time. T|herefore|
|00002430| 2c 0d 20 69 66 20 61 20 | 66 61 69 6c 75 72 65 20 |,. if a |failure |
|00002440| 6f 63 63 75 72 73 20 68 | 65 72 65 2c 20 77 65 20 |occurs h|ere, we |
|00002450| 77 69 6c 6c 20 61 73 73 | 75 6d 65 20 74 68 61 74 |will ass|ume that|
|00002460| 20 74 68 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e | the app|lication|
|00002470| 20 69 73 20 69 6e 20 73 | 75 63 68 0d 20 62 61 64 | is in s|uch. bad|
|00002480| 20 73 68 61 70 65 20 74 | 68 61 74 20 77 65 20 73 | shape t|hat we s|
|00002490| 68 6f 75 6c 64 20 6a 75 | 73 74 20 65 78 69 74 2e |hould ju|st exit.|
|000024a0| 20 59 6f 75 72 20 65 72 | 72 6f 72 20 68 61 6e 64 | Your er|ror hand|
|000024b0| 6c 69 6e 67 20 6d 61 79 | 20 64 69 66 66 65 72 2c |ling may| differ,|
|000024c0| 20 62 75 74 0d 20 74 68 | 65 20 63 68 65 63 6b 20 | but. th|e check |
|000024d0| 73 68 6f 75 6c 64 20 73 | 74 69 6c 6c 20 62 65 20 |should s|till be |
|000024e0| 6d 61 64 65 2e 7d 0d 20 | 0d 54 59 50 45 0d 09 52 |made.}. |.TYPE..R|
|000024f0| 65 63 74 50 74 72 09 09 | 3d 20 5e 52 65 63 74 3b |ectPtr..|= ^Rect;|
|00002500| 0d 09 52 65 63 74 48 6e | 64 09 09 3d 20 5e 52 65 |..RectHn|d..= ^Re|
|00002510| 63 74 50 74 72 3b 0d 56 | 41 52 0d 09 72 65 73 6f |ctPtr;.V|AR..reso|
|00002520| 75 72 63 65 09 3a 20 48 | 61 6e 64 6c 65 3b 0d 42 |urce.: H|andle;.B|
|00002530| 45 47 49 4e 0d 09 72 65 | 73 6f 75 72 63 65 20 3a |EGIN..re|source :|
|00002540| 3d 20 47 65 74 52 65 73 | 6f 75 72 63 65 28 27 52 |= GetRes|ource('R|
|00002550| 45 43 54 27 2c 20 72 65 | 63 74 49 44 29 3b 0d 09 |ECT', re|ctID);..|
|00002560| 49 46 20 72 65 73 6f 75 | 72 63 65 20 3d 20 4e 49 |IF resou|rce = NI|
|00002570| 4c 20 54 48 45 4e 20 45 | 78 69 74 54 6f 53 68 65 |L THEN E|xitToShe|
|00002580| 6c 6c 3b 0d 09 74 68 65 | 52 65 63 74 20 3a 3d 20 |ll;..the|Rect := |
|00002590| 52 65 63 74 48 6e 64 28 | 72 65 73 6f 75 72 63 65 |RectHnd(|resource|
|000025a0| 29 5e 5e 3b 0d 45 4e 44 | 3b 20 7b 47 6f 47 65 74 |)^^;.END|; {GoGet|
|000025b0| 52 65 63 74 7d 0d 0d 0d | 7b 24 53 20 49 6e 69 74 |Rect}...|{$S Init|
|000025c0| 69 61 6c 69 7a 65 7d 0d | 50 52 4f 43 45 44 55 52 |ialize}.|PROCEDUR|
|000025d0| 45 20 49 6e 69 74 69 61 | 6c 69 7a 65 3b 0d 0d 7b |E Initia|lize;..{|
|000025e0| 53 65 74 20 75 70 20 74 | 68 65 20 77 68 6f 6c 65 |Set up t|he whole|
|000025f0| 20 77 6f 72 6c 64 2c 20 | 69 6e 63 6c 75 64 69 6e | world, |includin|
|00002600| 67 20 67 6c 6f 62 61 6c | 20 76 61 72 69 61 62 6c |g global| variabl|
|00002610| 65 73 2c 20 54 6f 6f 6c | 62 6f 78 20 6d 61 6e 61 |es, Tool|box mana|
|00002620| 67 65 72 73 2c 0d 20 61 | 6e 64 20 6d 65 6e 75 73 |gers,. a|nd menus|
|00002630| 2e 20 57 65 20 61 6c 73 | 6f 20 63 72 65 61 74 65 |. We als|o create|
|00002640| 20 6f 75 72 20 6f 6e 65 | 20 61 70 70 6c 69 63 61 | our one| applica|
|00002650| 74 69 6f 6e 20 77 69 6e | 64 6f 77 20 61 74 20 74 |tion win|dow at t|
|00002660| 68 69 73 20 74 69 6d 65 | 2e 0d 20 53 69 6e 63 65 |his time|.. Since|
|00002670| 20 77 69 6e 64 6f 77 20 | 73 74 6f 72 61 67 65 20 | window |storage |
|00002680| 69 73 20 6e 6f 6e 2d 72 | 65 6c 6f 63 61 74 65 61 |is non-r|elocatea|
|00002690| 62 6c 65 2c 20 68 6f 77 | 20 61 6e 64 20 77 68 65 |ble, how| and whe|
|000026a0| 6e 20 74 6f 20 61 6c 6c | 6f 63 61 74 65 20 73 70 |n to all|ocate sp|
|000026b0| 61 63 65 0d 20 66 6f 72 | 20 77 69 6e 64 6f 77 73 |ace. for| windows|
|000026c0| 20 69 73 20 76 65 72 79 | 20 69 6d 70 6f 72 74 61 | is very| importa|
|000026d0| 6e 74 20 73 6f 20 74 68 | 61 74 20 68 65 61 70 20 |nt so th|at heap |
|000026e0| 66 72 61 67 6d 65 6e 74 | 61 74 69 6f 6e 20 64 6f |fragment|ation do|
|000026f0| 65 73 20 6e 6f 74 20 6f | 63 63 75 72 2e 0d 20 42 |es not o|ccur.. B|
|00002700| 65 63 61 75 73 65 20 53 | 61 6d 70 6c 65 20 68 61 |ecause S|ample ha|
|00002710| 73 20 6f 6e 6c 79 20 6f | 6e 65 20 77 69 6e 64 6f |s only o|ne windo|
|00002720| 77 20 61 6e 64 20 69 74 | 20 69 73 20 6f 6e 6c 79 |w and it| is only|
|00002730| 20 64 69 73 70 6f 73 65 | 64 20 77 68 65 6e 20 74 | dispose|d when t|
|00002740| 68 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 0d 20 |he appli|cation. |
|00002750| 71 75 69 74 73 2c 20 77 | 65 20 77 69 6c 6c 20 61 |quits, w|e will a|
|00002760| 6c 6c 6f 63 61 74 65 20 | 69 74 73 20 73 70 61 63 |llocate |its spac|
|00002770| 65 20 68 65 72 65 2c 20 | 62 65 66 6f 72 65 20 61 |e here, |before a|
|00002780| 6e 79 74 68 69 6e 67 20 | 74 68 61 74 20 6d 69 67 |nything |that mig|
|00002790| 68 74 20 62 65 20 61 20 | 6c 6f 63 6b 65 64 0d 20 |ht be a |locked. |
|000027a0| 72 65 6c 6f 63 61 74 61 | 62 6c 65 20 6f 62 6a 65 |relocata|ble obje|
|000027b0| 63 74 20 67 65 74 73 20 | 69 6e 74 6f 20 74 68 65 |ct gets |into the|
|000027c0| 20 68 65 61 70 2e 20 54 | 68 69 73 20 77 61 79 2c | heap. T|his way,|
|000027d0| 20 77 65 20 63 61 6e 20 | 66 6f 72 63 65 20 69 74 | we can |force it|
|000027e0| 73 20 73 74 6f 72 61 67 | 65 20 74 6f 20 62 65 0d |s storag|e to be.|
|000027f0| 20 69 6e 20 74 68 65 20 | 6c 6f 77 65 73 74 20 6d | in the |lowest m|
|00002800| 65 6d 6f 72 79 20 61 76 | 61 69 6c 61 62 6c 65 20 |emory av|ailable |
|00002810| 69 6e 20 74 68 65 20 68 | 65 61 70 2e 20 57 69 6e |in the h|eap. Win|
|00002820| 64 6f 77 20 73 74 6f 72 | 61 67 65 20 63 61 6e 20 |dow stor|age can |
|00002830| 64 69 66 66 65 72 20 77 | 69 64 65 6c 79 0d 20 61 |differ w|idely. a|
|00002840| 6d 6f 6e 67 73 74 20 61 | 70 70 6c 69 63 61 74 69 |mongst a|pplicati|
|00002850| 6f 6e 73 20 64 65 70 65 | 6e 64 69 6e 67 20 6f 6e |ons depe|nding on|
|00002860| 20 68 6f 77 20 6d 61 6e | 79 20 77 69 6e 64 6f 77 | how man|y window|
|00002870| 73 20 61 72 65 20 63 72 | 65 61 74 65 64 20 61 6e |s are cr|eated an|
|00002880| 64 20 64 69 73 70 6f 73 | 65 64 2e 0d 20 49 66 20 |d dispos|ed.. If |
|00002890| 61 20 66 61 69 6c 75 72 | 65 20 6f 63 63 75 72 73 |a failur|e occurs|
|000028a0| 20 68 65 72 65 2c 20 77 | 65 20 77 69 6c 6c 20 63 | here, w|e will c|
|000028b0| 6f 6e 73 69 64 65 72 20 | 74 68 61 74 20 74 68 65 |onsider |that the|
|000028c0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 69 73 20 | applica|tion is |
|000028d0| 69 6e 20 73 75 63 68 0d | 20 62 61 64 20 73 68 61 |in such.| bad sha|
|000028e0| 70 65 20 74 68 61 74 20 | 77 65 20 73 68 6f 75 6c |pe that |we shoul|
|000028f0| 64 20 6a 75 73 74 20 65 | 78 69 74 2e 20 59 6f 75 |d just e|xit. You|
|00002900| 72 20 65 72 72 6f 72 20 | 68 61 6e 64 6c 69 6e 67 |r error |handling|
|00002910| 20 6d 61 79 20 64 69 66 | 66 65 72 2c 20 62 75 74 | may dif|fer, but|
|00002920| 0d 20 74 68 65 20 63 68 | 65 63 6b 73 20 73 68 6f |. the ch|ecks sho|
|00002930| 75 6c 64 20 73 74 69 6c | 6c 20 62 65 20 6d 61 64 |uld stil|l be mad|
|00002940| 65 2e 7d 0d 0d 56 41 52 | 0d 09 6d 65 6e 75 42 61 |e.}..VAR|..menuBa|
|00002950| 72 09 09 3a 20 48 61 6e | 64 6c 65 3b 0d 09 77 69 |r..: Han|dle;..wi|
|00002960| 6e 64 6f 77 09 09 3a 20 | 57 69 6e 64 6f 77 50 74 |ndow..: |WindowPt|
|00002970| 72 3b 0d 0d 42 45 47 49 | 4e 0d 09 67 48 61 73 57 |r;..BEGI|N..gHasW|
|00002980| 61 69 74 4e 65 78 74 45 | 76 65 6e 74 20 3a 3d 20 |aitNextE|vent := |
|00002990| 54 72 61 70 41 76 61 69 | 6c 61 62 6c 65 28 5f 57 |TrapAvai|lable(_W|
|000029a0| 61 69 74 4e 65 78 74 45 | 76 65 6e 74 2c 20 54 6f |aitNextE|vent, To|
|000029b0| 6f 6c 54 72 61 70 29 3b | 0d 09 67 49 6e 42 61 63 |olTrap);|..gInBac|
|000029c0| 6b 67 72 6f 75 6e 64 20 | 3a 3d 20 46 41 4c 53 45 |kground |:= FALSE|
|000029d0| 3b 0d 0d 09 49 6e 69 74 | 47 72 61 66 28 40 74 68 |;...Init|Graf(@th|
|000029e0| 65 50 6f 72 74 29 3b 0d | 09 49 6e 69 74 46 6f 6e |ePort);.|.InitFon|
|000029f0| 74 73 3b 0d 09 49 6e 69 | 74 57 69 6e 64 6f 77 73 |ts;..Ini|tWindows|
|00002a00| 3b 0d 09 49 6e 69 74 4d | 65 6e 75 73 3b 0d 09 54 |;..InitM|enus;..T|
|00002a10| 45 49 6e 69 74 3b 0d 09 | 49 6e 69 74 44 69 61 6c |EInit;..|InitDial|
|00002a20| 6f 67 73 28 4e 49 4c 29 | 3b 0d 09 49 6e 69 74 43 |ogs(NIL)|;..InitC|
|00002a30| 75 72 73 6f 72 3b 0d 0d | 7b 09 77 65 20 77 69 6c |ursor;..|{.we wil|
|00002a40| 6c 20 61 6c 6c 6f 63 61 | 74 65 20 6f 75 72 20 6f |l alloca|te our o|
|00002a50| 77 6e 20 77 69 6e 64 6f | 77 20 73 74 6f 72 61 67 |wn windo|w storag|
|00002a60| 65 20 69 6e 73 74 65 61 | 64 20 6f 66 20 6c 65 74 |e instea|d of let|
|00002a70| 74 69 6e 67 20 74 68 65 | 20 57 69 6e 64 6f 77 0d |ting the| Window.|
|00002a80| 09 4d 61 6e 61 67 65 72 | 20 64 6f 20 69 74 20 62 |.Manager| do it b|
|00002a90| 65 63 61 75 73 65 20 47 | 65 74 4e 65 77 57 69 6e |ecause G|etNewWin|
|00002aa0| 64 6f 77 20 6d 61 79 20 | 6c 6f 61 64 20 69 6e 20 |dow may |load in |
|00002ab0| 74 65 6d 70 2e 20 72 65 | 73 6f 75 72 63 65 73 20 |temp. re|sources |
|00002ac0| 62 65 66 6f 72 65 0d 09 | 6d 61 6b 69 6e 67 20 74 |before..|making t|
|00002ad0| 68 65 20 4e 65 77 50 74 | 72 20 63 61 6c 6c 2c 20 |he NewPt|r call, |
|00002ae0| 61 6e 64 20 74 68 69 73 | 20 63 61 6e 20 6c 65 61 |and this| can lea|
|00002af0| 64 20 74 6f 20 68 65 61 | 70 20 66 72 61 67 6d 65 |d to hea|p fragme|
|00002b00| 6e 74 61 74 69 6f 6e 2e | 20 7d 0d 09 77 69 6e 64 |ntation.| }..wind|
|00002b10| 6f 77 20 3a 3d 20 57 69 | 6e 64 6f 77 50 74 72 28 |ow := Wi|ndowPtr(|
|00002b20| 4e 65 77 50 74 72 28 53 | 49 5a 45 4f 46 28 57 69 |NewPtr(S|IZEOF(Wi|
|00002b30| 6e 64 6f 77 52 65 63 6f | 72 64 29 29 29 3b 0d 09 |ndowReco|rd)));..|
|00002b40| 49 46 20 77 69 6e 64 6f | 77 20 3d 20 4e 49 4c 20 |IF windo|w = NIL |
|00002b50| 54 48 45 4e 20 45 78 69 | 74 54 6f 53 68 65 6c 6c |THEN Exi|tToShell|
|00002b60| 3b 0d 09 77 69 6e 64 6f | 77 20 3a 3d 20 47 65 74 |;..windo|w := Get|
|00002b70| 4e 65 77 57 69 6e 64 6f | 77 28 72 57 69 6e 64 6f |NewWindo|w(rWindo|
|00002b80| 77 2c 20 50 74 72 28 77 | 69 6e 64 6f 77 29 2c 20 |w, Ptr(w|indow), |
|00002b90| 57 69 6e 64 6f 77 50 74 | 72 28 2d 31 29 29 3b 0d |WindowPt|r(-1));.|
|00002ba0| 0d 09 6d 65 6e 75 42 61 | 72 20 3a 3d 20 47 65 74 |..menuBa|r := Get|
|00002bb0| 4e 65 77 4d 42 61 72 28 | 72 4d 65 6e 75 42 61 72 |NewMBar(|rMenuBar|
|00002bc0| 29 3b 09 09 7b 72 65 61 | 64 20 6d 65 6e 75 73 20 |);..{rea|d menus |
|00002bd0| 69 6e 74 6f 20 6d 65 6e | 75 20 62 61 72 7d 0d 09 |into men|u bar}..|
|00002be0| 49 46 20 6d 65 6e 75 42 | 61 72 20 3d 20 4e 49 4c |IF menuB|ar = NIL|
|00002bf0| 20 54 48 45 4e 20 45 78 | 69 74 54 6f 53 68 65 6c | THEN Ex|itToShel|
|00002c00| 6c 3b 0d 09 53 65 74 4d | 65 6e 75 42 61 72 28 6d |l;..SetM|enuBar(m|
|00002c10| 65 6e 75 42 61 72 29 3b | 09 09 09 09 09 7b 69 6e |enuBar);|.....{in|
|00002c20| 73 74 61 6c 6c 20 6d 65 | 6e 75 73 7d 0d 09 44 69 |stall me|nus}..Di|
|00002c30| 73 70 6f 73 48 61 6e 64 | 6c 65 28 6d 65 6e 75 42 |sposHand|le(menuB|
|00002c40| 61 72 29 3b 0d 09 41 64 | 64 52 65 73 4d 65 6e 75 |ar);..Ad|dResMenu|
|00002c50| 28 47 65 74 4d 48 61 6e | 64 6c 65 28 6d 41 70 70 |(GetMHan|dle(mApp|
|00002c60| 6c 65 29 2c 20 27 44 52 | 56 52 27 29 3b 09 7b 61 |le), 'DR|VR');.{a|
|00002c70| 64 64 20 44 41 20 6e 61 | 6d 65 73 20 74 6f 20 41 |dd DA na|mes to A|
|00002c80| 70 70 6c 65 20 6d 65 6e | 75 7d 0d 09 44 72 61 77 |pple men|u}..Draw|
|00002c90| 4d 65 6e 75 42 61 72 3b | 0d 0d 09 67 53 74 6f 70 |MenuBar;|...gStop|
|00002ca0| 70 65 64 20 3a 3d 20 54 | 52 55 45 3b 0d 09 47 6f |ped := T|RUE;..Go|
|00002cb0| 47 65 74 52 65 63 74 28 | 72 53 74 6f 70 52 65 63 |GetRect(|rStopRec|
|00002cc0| 74 2c 20 67 53 74 6f 70 | 52 65 63 74 29 3b 09 09 |t, gStop|Rect);..|
|00002cd0| 7b 74 68 65 20 73 74 6f | 70 20 6c 69 67 68 74 20 |{the sto|p light |
|00002ce0| 72 65 63 74 61 6e 67 6c | 65 7d 0d 09 47 6f 47 65 |rectangl|e}..GoGe|
|00002cf0| 74 52 65 63 74 28 72 47 | 6f 52 65 63 74 2c 20 67 |tRect(rG|oRect, g|
|00002d00| 47 6f 52 65 63 74 29 3b | 09 09 09 7b 74 68 65 20 |GoRect);|...{the |
|00002d10| 67 6f 20 6c 69 67 68 74 | 20 72 65 63 74 61 6e 67 |go light| rectang|
|00002d20| 6c 65 7d 0d 45 4e 44 3b | 20 7b 49 6e 69 74 69 61 |le}.END;| {Initia|
|00002d30| 6c 69 7a 65 7d 0d 0d 0d | 7b 24 53 20 4d 61 69 6e |lize}...|{$S Main|
|00002d40| 7d 0d 50 52 4f 43 45 44 | 55 52 45 20 44 6f 43 6c |}.PROCED|URE DoCl|
|00002d50| 6f 73 65 42 65 68 69 6e | 64 28 77 69 6e 64 6f 77 |oseBehin|d(window|
|00002d60| 3a 20 57 69 6e 64 6f 77 | 50 74 72 29 3b 0d 0d 7b |: Window|Ptr);..{|
|00002d70| 43 6c 6f 73 65 20 74 68 | 65 20 77 69 6e 64 6f 77 |Close th|e window|
|00002d80| 20 74 68 61 74 20 69 73 | 20 70 61 73 73 65 64 20 | that is| passed |
|00002d90| 61 6e 64 20 61 6c 6c 20 | 77 69 6e 64 6f 77 73 20 |and all |windows |
|00002da0| 62 65 68 69 6e 64 20 69 | 74 2e 0d 20 54 68 69 73 |behind i|t.. This|
|00002db0| 20 63 6c 6f 73 65 73 20 | 77 69 6e 64 6f 77 73 20 | closes |windows |
|00002dc0| 66 72 6f 6d 20 62 61 63 | 6b 20 74 6f 20 66 72 6f |from bac|k to fro|
|00002dd0| 6e 74 2c 20 62 79 20 63 | 61 6c 6c 69 6e 67 20 69 |nt, by c|alling i|
|00002de0| 74 73 65 6c 66 0d 20 72 | 65 63 75 72 73 69 76 65 |tself. r|ecursive|
|00002df0| 6c 79 2c 20 77 68 69 63 | 68 20 6d 69 6e 69 6d 69 |ly, whic|h minimi|
|00002e00| 7a 65 73 20 77 69 6e 64 | 6f 77 20 75 70 64 61 74 |zes wind|ow updat|
|00002e10| 69 6e 67 2e 20 41 6c 77 | 61 79 73 20 6b 65 65 70 |ing. Alw|ays keep|
|00002e20| 0d 20 69 6e 20 6d 69 6e | 64 20 74 68 65 20 64 61 |. in min|d the da|
|00002e30| 6e 67 65 72 73 20 6f 66 | 20 73 74 61 63 6b 20 6f |ngers of| stack o|
|00002e40| 76 65 72 66 6c 6f 77 20 | 77 68 65 6e 20 72 65 63 |verflow |when rec|
|00002e50| 75 72 73 69 76 65 20 72 | 6f 75 74 69 6e 65 73 0d |ursive r|outines.|
|00002e60| 20 61 72 65 20 75 73 65 | 64 20 69 6e 20 73 69 74 | are use|d in sit|
|00002e70| 75 61 74 69 6f 6e 73 20 | 77 68 65 72 65 20 74 68 |uations |where th|
|00002e80| 65 20 63 61 6c 6c 69 6e | 67 20 6c 65 76 65 6c 20 |e callin|g level |
|00002e90| 67 65 74 73 20 74 6f 6f | 0d 20 64 65 65 70 2e 20 |gets too|. deep. |
|00002ea0| 54 68 61 74 20 69 73 20 | 6e 6f 74 20 61 20 70 72 |That is |not a pr|
|00002eb0| 6f 62 6c 65 6d 20 68 65 | 72 65 2e 7d 0d 0d 42 45 |oblem he|re.}..BE|
|00002ec0| 47 49 4e 0d 09 49 46 20 | 77 69 6e 64 6f 77 20 3c |GIN..IF |window <|
|00002ed0| 3e 20 4e 49 4c 20 54 48 | 45 4e 20 42 45 47 49 4e |> NIL TH|EN BEGIN|
|00002ee0| 09 7b 69 66 20 77 65 20 | 61 72 65 20 70 61 73 73 |.{if we |are pass|
|00002ef0| 65 64 20 61 20 77 69 6e | 64 6f 77 2c 20 63 6c 6f |ed a win|dow, clo|
|00002f00| 73 65 20 6f 74 68 65 72 | 20 77 69 6e 64 6f 77 73 |se other| windows|
|00002f10| 20 62 65 68 69 6e 64 20 | 69 74 20 66 69 72 73 74 | behind |it first|
|00002f20| 7d 0d 09 09 44 6f 43 6c | 6f 73 65 42 65 68 69 6e |}...DoCl|oseBehin|
|00002f30| 64 28 57 69 6e 64 6f 77 | 50 74 72 28 57 69 6e 64 |d(Window|Ptr(Wind|
|00002f40| 6f 77 50 65 65 6b 28 77 | 69 6e 64 6f 77 29 5e 2e |owPeek(w|indow)^.|
|00002f50| 6e 65 78 74 57 69 6e 64 | 6f 77 29 29 3b 0d 09 09 |nextWind|ow));...|
|00002f60| 44 6f 43 6c 6f 73 65 57 | 69 6e 64 6f 77 28 77 69 |DoCloseW|indow(wi|
|00002f70| 6e 64 6f 77 29 3b 09 7b | 6e 6f 77 20 74 68 61 74 |ndow);.{|now that|
|00002f80| 20 61 6c 6c 20 74 68 65 | 20 77 69 6e 64 6f 77 73 | all the| windows|
|00002f90| 20 62 65 68 69 6e 64 20 | 61 72 65 20 63 6c 6f 73 | behind |are clos|
|00002fa0| 65 64 2c 20 63 6c 6f 73 | 65 20 74 68 69 73 20 6f |ed, clos|e this o|
|00002fb0| 6e 65 7d 0d 09 45 4e 44 | 3b 0d 45 4e 44 3b 20 7b |ne}..END|;.END; {|
|00002fc0| 44 6f 43 6c 6f 73 65 42 | 65 68 69 6e 64 7d 0d 0d |DoCloseB|ehind}..|
|00002fd0| 0d 7b 24 53 20 4d 61 69 | 6e 7d 0d 50 52 4f 43 45 |.{$S Mai|n}.PROCE|
|00002fe0| 44 55 52 45 20 54 65 72 | 6d 69 6e 61 74 65 3b 0d |DURE Ter|minate;.|
|00002ff0| 0d 7b 43 6c 65 61 6e 20 | 75 70 20 74 68 65 20 61 |.{Clean |up the a|
|00003000| 70 70 6c 69 63 61 74 69 | 6f 6e 20 61 6e 64 20 65 |pplicati|on and e|
|00003010| 78 69 74 73 2e 20 57 65 | 20 63 6c 6f 73 65 20 61 |xits. We| close a|
|00003020| 6c 6c 20 6f 66 20 74 68 | 65 20 77 69 6e 64 6f 77 |ll of th|e window|
|00003030| 73 20 73 6f 20 74 68 61 | 74 0d 20 74 68 65 79 20 |s so tha|t. they |
|00003040| 63 61 6e 20 75 70 64 61 | 74 65 20 74 68 65 69 72 |can upda|te their|
|00003050| 20 64 6f 63 75 6d 65 6e | 74 73 2c 20 69 66 20 61 | documen|ts, if a|
|00003060| 6e 79 2e 7d 0d 0d 42 45 | 47 49 4e 0d 09 44 6f 43 |ny.}..BE|GIN..DoC|
|00003070| 6c 6f 73 65 42 65 68 69 | 6e 64 28 46 72 6f 6e 74 |loseBehi|nd(Front|
|00003080| 57 69 6e 64 6f 77 29 3b | 09 7b 63 6c 6f 73 65 20 |Window);|.{close |
|00003090| 61 6c 6c 20 77 69 6e 64 | 6f 77 73 7d 0d 09 45 78 |all wind|ows}..Ex|
|000030a0| 69 74 54 6f 53 68 65 6c | 6c 3b 0d 45 4e 44 3b 20 |itToShel|l;.END; |
|000030b0| 7b 54 65 72 6d 69 6e 61 | 74 65 7d 0d 0d 0d 7b 24 |{Termina|te}...{$|
|000030c0| 53 20 4d 61 69 6e 7d 0d | 50 52 4f 43 45 44 55 52 |S Main}.|PROCEDUR|
|000030d0| 45 20 53 65 74 4c 69 67 | 68 74 28 77 69 6e 64 6f |E SetLig|ht(windo|
|000030e0| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 3b 20 6e 65 |w: Windo|wPtr; ne|
|000030f0| 77 53 74 6f 70 70 65 64 | 3a 20 42 4f 4f 4c 45 41 |wStopped|: BOOLEA|
|00003100| 4e 29 3b 0d 0d 7b 43 68 | 61 6e 67 65 20 74 68 65 |N);..{Ch|ange the|
|00003110| 20 73 65 74 74 69 6e 67 | 20 6f 66 20 74 68 65 20 | setting| of the |
|00003120| 6c 69 67 68 74 2e 7d 0d | 0d 42 45 47 49 4e 0d 09 |light.}.|.BEGIN..|
|00003130| 49 46 20 6e 65 77 53 74 | 6f 70 70 65 64 20 3c 3e |IF newSt|opped <>|
|00003140| 20 67 53 74 6f 70 70 65 | 64 20 54 48 45 4e 20 42 | gStoppe|d THEN B|
|00003150| 45 47 49 4e 0d 09 09 67 | 53 74 6f 70 70 65 64 20 |EGIN...g|Stopped |
|00003160| 3a 3d 20 6e 65 77 53 74 | 6f 70 70 65 64 3b 0d 09 |:= newSt|opped;..|
|00003170| 09 53 65 74 50 6f 72 74 | 28 77 69 6e 64 6f 77 29 |.SetPort|(window)|
|00003180| 3b 0d 09 09 49 6e 76 61 | 6c 52 65 63 74 28 77 69 |;...Inva|lRect(wi|
|00003190| 6e 64 6f 77 5e 2e 70 6f | 72 74 52 65 63 74 29 3b |ndow^.po|rtRect);|
|000031a0| 0d 09 45 4e 44 3b 0d 45 | 4e 44 3b 20 7b 53 65 74 |..END;.E|ND; {Set|
|000031b0| 4c 69 67 68 74 7d 0d 0d | 0d 7b 24 53 20 4d 61 69 |Light}..|.{$S Mai|
|000031c0| 6e 7d 0d 50 52 4f 43 45 | 44 55 52 45 20 41 64 6a |n}.PROCE|DURE Adj|
|000031d0| 75 73 74 4d 65 6e 75 73 | 3b 0d 0d 7b 45 6e 61 62 |ustMenus|;..{Enab|
|000031e0| 6c 65 20 61 6e 64 20 64 | 69 73 61 62 6c 65 20 6d |le and d|isable m|
|000031f0| 65 6e 75 73 20 62 61 73 | 65 64 20 6f 6e 20 74 68 |enus bas|ed on th|
|00003200| 65 20 63 75 72 72 65 6e | 74 20 73 74 61 74 65 2e |e curren|t state.|
|00003210| 0d 20 54 68 65 20 75 73 | 65 72 20 63 61 6e 20 6f |. The us|er can o|
|00003220| 6e 6c 79 20 73 65 6c 65 | 63 74 20 65 6e 61 62 6c |nly sele|ct enabl|
|00003230| 65 64 20 6d 65 6e 75 20 | 69 74 65 6d 73 2e 20 57 |ed menu |items. W|
|00003240| 65 20 73 65 74 20 75 70 | 20 61 6c 6c 20 74 68 65 |e set up| all the|
|00003250| 20 6d 65 6e 75 20 69 74 | 65 6d 73 0d 20 62 65 66 | menu it|ems. bef|
|00003260| 6f 72 65 20 63 61 6c 6c | 69 6e 67 20 4d 65 6e 75 |ore call|ing Menu|
|00003270| 53 65 6c 65 63 74 20 6f | 72 20 4d 65 6e 75 4b 65 |Select o|r MenuKe|
|00003280| 79 2c 20 73 69 6e 63 65 | 20 74 68 65 73 65 20 61 |y, since| these a|
|00003290| 72 65 20 74 68 65 20 6f | 6e 6c 79 20 74 69 6d 65 |re the o|nly time|
|000032a0| 73 20 74 68 61 74 0d 20 | 61 20 6d 65 6e 75 20 69 |s that. |a menu i|
|000032b0| 74 65 6d 20 63 61 6e 20 | 62 65 20 73 65 6c 65 63 |tem can |be selec|
|000032c0| 74 65 64 2e 20 4e 6f 74 | 65 20 74 68 61 74 20 4d |ted. Not|e that M|
|000032d0| 65 6e 75 53 65 6c 65 63 | 74 20 69 73 20 61 6c 73 |enuSelec|t is als|
|000032e0| 6f 20 74 68 65 20 6f 6e | 6c 79 20 74 69 6d 65 0d |o the on|ly time.|
|000032f0| 20 74 68 65 20 75 73 65 | 72 20 77 69 6c 6c 20 73 | the use|r will s|
|00003300| 65 65 20 6d 65 6e 75 20 | 69 74 65 6d 73 2e 20 54 |ee menu |items. T|
|00003310| 68 69 73 20 61 70 70 72 | 6f 61 63 68 20 74 6f 20 |his appr|oach to |
|00003320| 64 65 63 69 64 69 6e 67 | 20 77 68 61 74 20 65 6e |deciding| what en|
|00003330| 61 62 6c 65 2f 0d 20 64 | 69 73 61 62 6c 65 20 73 |able/. d|isable s|
|00003340| 74 61 74 65 20 61 20 6d | 65 6e 75 20 69 74 65 6d |tate a m|enu item|
|00003350| 20 68 61 73 20 74 68 65 | 20 61 64 76 61 6e 74 61 | has the| advanta|
|00003360| 67 65 20 6f 66 20 63 6f | 6e 63 65 6e 74 72 61 74 |ge of co|ncentrat|
|00003370| 69 6e 67 20 61 6c 6c 20 | 74 68 65 20 64 65 63 69 |ing all |the deci|
|00003380| 73 69 6f 6e 2d 0d 20 6d | 61 6b 69 6e 67 20 69 6e |sion-. m|aking in|
|00003390| 20 6f 6e 65 20 72 6f 75 | 74 69 6e 65 2c 20 61 73 | one rou|tine, as|
|000033a0| 20 6f 70 70 6f 73 65 64 | 20 74 6f 20 62 65 69 6e | opposed| to bein|
|000033b0| 67 20 73 70 72 65 61 64 | 20 74 68 72 6f 75 67 68 |g spread| through|
|000033c0| 6f 75 74 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 |out the |applicat|
|000033d0| 69 6f 6e 2e 0d 20 4f 74 | 68 65 72 20 61 70 70 6c |ion.. Ot|her appl|
|000033e0| 69 63 61 74 69 6f 6e 20 | 64 65 73 69 67 6e 73 20 |ication |designs |
|000033f0| 6d 61 79 20 74 61 6b 65 | 20 61 20 64 69 66 66 65 |may take| a diffe|
|00003400| 72 65 6e 74 20 61 70 70 | 72 6f 61 63 68 20 74 68 |rent app|roach th|
|00003410| 61 74 20 69 73 20 6a 75 | 73 74 20 61 73 20 76 61 |at is ju|st as va|
|00003420| 6c 69 64 2e 7d 0d 0d 56 | 41 52 0d 09 77 69 6e 64 |lid.}..V|AR..wind|
|00003430| 6f 77 09 09 09 3a 20 57 | 69 6e 64 6f 77 50 74 72 |ow...: W|indowPtr|
|00003440| 3b 0d 09 6d 65 6e 75 09 | 09 09 3a 20 4d 65 6e 75 |;..menu.|..: Menu|
|00003450| 48 61 6e 64 6c 65 3b 0d | 0d 42 45 47 49 4e 0d 09 |Handle;.|.BEGIN..|
|00003460| 77 69 6e 64 6f 77 20 3a | 3d 20 46 72 6f 6e 74 57 |window :|= FrontW|
|00003470| 69 6e 64 6f 77 3b 0d 0d | 09 6d 65 6e 75 20 3a 3d |indow;..|.menu :=|
|00003480| 20 47 65 74 4d 48 61 6e | 64 6c 65 28 6d 46 69 6c | GetMHan|dle(mFil|
|00003490| 65 29 3b 0d 09 49 46 20 | 49 73 44 41 57 69 6e 64 |e);..IF |IsDAWind|
|000034a0| 6f 77 28 77 69 6e 64 6f | 77 29 20 54 48 45 4e 09 |ow(windo|w) THEN.|
|000034b0| 09 09 09 7b 77 65 20 63 | 61 6e 20 61 6c 6c 6f 77 |...{we c|an allow|
|000034c0| 20 64 65 73 6b 20 61 63 | 63 65 73 73 6f 72 69 65 | desk ac|cessorie|
|000034d0| 73 20 74 6f 20 62 65 20 | 63 6c 6f 73 65 64 20 66 |s to be |closed f|
|000034e0| 72 6f 6d 20 74 68 65 20 | 6d 65 6e 75 7d 0d 09 09 |rom the |menu}...|
|000034f0| 45 6e 61 62 6c 65 49 74 | 65 6d 28 6d 65 6e 75 2c |EnableIt|em(menu,|
|00003500| 20 69 43 6c 6f 73 65 29 | 0d 09 45 4c 53 45 0d 09 | iClose)|..ELSE..|
|00003510| 09 44 69 73 61 62 6c 65 | 49 74 65 6d 28 6d 65 6e |.Disable|Item(men|
|00003520| 75 2c 20 69 43 6c 6f 73 | 65 29 3b 09 09 09 7b 62 |u, iClos|e);...{b|
|00003530| 75 74 20 6e 6f 74 20 6f | 75 72 20 74 72 61 66 66 |ut not o|ur traff|
|00003540| 69 63 20 6c 69 67 68 74 | 20 77 69 6e 64 6f 77 7d |ic light| window}|
|00003550| 0d 0d 09 6d 65 6e 75 20 | 3a 3d 20 47 65 74 4d 48 |...menu |:= GetMH|
|00003560| 61 6e 64 6c 65 28 6d 45 | 64 69 74 29 3b 0d 09 49 |andle(mE|dit);..I|
|00003570| 46 20 49 73 44 41 57 69 | 6e 64 6f 77 28 77 69 6e |F IsDAWi|ndow(win|
|00003580| 64 6f 77 29 20 54 48 45 | 4e 20 42 45 47 49 4e 09 |dow) THE|N BEGIN.|
|00003590| 09 7b 61 20 64 65 73 6b | 20 61 63 63 65 73 73 6f |.{a desk| accesso|
|000035a0| 72 79 20 6d 69 67 68 74 | 20 6e 65 65 64 20 74 68 |ry might| need th|
|000035b0| 65 20 65 64 69 74 20 6d | 65 6e 75 7d 0d 09 09 45 |e edit m|enu}...E|
|000035c0| 6e 61 62 6c 65 49 74 65 | 6d 28 6d 65 6e 75 2c 20 |nableIte|m(menu, |
|000035d0| 69 55 6e 64 6f 29 3b 0d | 09 09 45 6e 61 62 6c 65 |iUndo);.|..Enable|
|000035e0| 49 74 65 6d 28 6d 65 6e | 75 2c 20 69 43 75 74 29 |Item(men|u, iCut)|
|000035f0| 3b 0d 09 09 45 6e 61 62 | 6c 65 49 74 65 6d 28 6d |;...Enab|leItem(m|
|00003600| 65 6e 75 2c 20 69 43 6f | 70 79 29 3b 0d 09 09 45 |enu, iCo|py);...E|
|00003610| 6e 61 62 6c 65 49 74 65 | 6d 28 6d 65 6e 75 2c 20 |nableIte|m(menu, |
|00003620| 69 50 61 73 74 65 29 3b | 0d 09 09 45 6e 61 62 6c |iPaste);|...Enabl|
|00003630| 65 49 74 65 6d 28 6d 65 | 6e 75 2c 20 69 43 6c 65 |eItem(me|nu, iCle|
|00003640| 61 72 29 3b 0d 09 45 4e | 44 20 45 4c 53 45 20 42 |ar);..EN|D ELSE B|
|00003650| 45 47 49 4e 09 09 09 09 | 09 09 09 7b 62 75 74 20 |EGIN....|...{but |
|00003660| 77 65 20 6b 6e 6f 77 20 | 77 65 20 64 6f 20 6e 6f |we know |we do no|
|00003670| 74 7d 0d 09 09 44 69 73 | 61 62 6c 65 49 74 65 6d |t}...Dis|ableItem|
|00003680| 28 6d 65 6e 75 2c 20 69 | 55 6e 64 6f 29 3b 0d 09 |(menu, i|Undo);..|
|00003690| 09 44 69 73 61 62 6c 65 | 49 74 65 6d 28 6d 65 6e |.Disable|Item(men|
|000036a0| 75 2c 20 69 43 75 74 29 | 3b 0d 09 09 44 69 73 61 |u, iCut)|;...Disa|
|000036b0| 62 6c 65 49 74 65 6d 28 | 6d 65 6e 75 2c 20 69 43 |bleItem(|menu, iC|
|000036c0| 6f 70 79 29 3b 0d 09 09 | 44 69 73 61 62 6c 65 49 |opy);...|DisableI|
|000036d0| 74 65 6d 28 6d 65 6e 75 | 2c 20 69 43 6c 65 61 72 |tem(menu|, iClear|
|000036e0| 29 3b 0d 09 09 44 69 73 | 61 62 6c 65 49 74 65 6d |);...Dis|ableItem|
|000036f0| 28 6d 65 6e 75 2c 20 69 | 50 61 73 74 65 29 3b 0d |(menu, i|Paste);.|
|00003700| 09 45 4e 44 3b 0d 0d 09 | 6d 65 6e 75 20 3a 3d 20 |.END;...|menu := |
|00003710| 47 65 74 4d 48 61 6e 64 | 6c 65 28 6d 4c 69 67 68 |GetMHand|le(mLigh|
|00003720| 74 29 3b 0d 09 49 46 20 | 49 73 41 70 70 57 69 6e |t);..IF |IsAppWin|
|00003730| 64 6f 77 28 77 69 6e 64 | 6f 77 29 20 54 48 45 4e |dow(wind|ow) THEN|
|00003740| 20 42 45 47 49 4e 09 09 | 7b 77 65 20 6b 6e 6f 77 | BEGIN..|{we know|
|00003750| 20 74 68 61 74 20 69 74 | 20 6d 75 73 74 20 62 65 | that it| must be|
|00003760| 20 74 68 65 20 74 72 61 | 66 66 69 63 20 6c 69 67 | the tra|ffic lig|
|00003770| 68 74 7d 0d 09 09 45 6e | 61 62 6c 65 49 74 65 6d |ht}...En|ableItem|
|00003780| 28 6d 65 6e 75 2c 20 69 | 53 74 6f 70 29 3b 0d 09 |(menu, i|Stop);..|
|00003790| 09 45 6e 61 62 6c 65 49 | 74 65 6d 28 6d 65 6e 75 |.EnableI|tem(menu|
|000037a0| 2c 20 69 47 6f 29 3b 0d | 09 45 4e 44 20 45 4c 53 |, iGo);.|.END ELS|
|000037b0| 45 20 42 45 47 49 4e 0d | 09 09 44 69 73 61 62 6c |E BEGIN.|..Disabl|
|000037c0| 65 49 74 65 6d 28 6d 65 | 6e 75 2c 20 69 53 74 6f |eItem(me|nu, iSto|
|000037d0| 70 29 3b 0d 09 09 44 69 | 73 61 62 6c 65 49 74 65 |p);...Di|sableIte|
|000037e0| 6d 28 6d 65 6e 75 2c 20 | 69 47 6f 29 3b 0d 09 45 |m(menu, |iGo);..E|
|000037f0| 4e 44 3b 0d 09 43 68 65 | 63 6b 49 74 65 6d 28 6d |ND;..Che|ckItem(m|
|00003800| 65 6e 75 2c 20 69 53 74 | 6f 70 2c 20 67 53 74 6f |enu, iSt|op, gSto|
|00003810| 70 70 65 64 29 3b 09 09 | 7b 77 65 20 63 61 6e 20 |pped);..|{we can |
|00003820| 61 6c 73 6f 20 64 65 74 | 65 72 6d 69 6e 65 20 63 |also det|ermine c|
|00003830| 68 65 63 6b 2f 75 6e 63 | 68 65 63 6b 20 73 74 61 |heck/unc|heck sta|
|00003840| 74 65 2c 20 74 6f 6f 7d | 0d 09 43 68 65 63 6b 49 |te, too}|..CheckI|
|00003850| 74 65 6d 28 6d 65 6e 75 | 2c 20 69 47 6f 2c 20 4e |tem(menu|, iGo, N|
|00003860| 4f 54 20 67 53 74 6f 70 | 70 65 64 29 3b 0d 45 4e |OT gStop|ped);.EN|
|00003870| 44 3b 20 7b 41 64 6a 75 | 73 74 4d 65 6e 75 73 7d |D; {Adju|stMenus}|
|00003880| 0d 0d 0d 7b 24 53 20 4d | 61 69 6e 7d 0d 50 52 4f |...{$S M|ain}.PRO|
|00003890| 43 45 44 55 52 45 20 44 | 6f 4d 65 6e 75 43 6f 6d |CEDURE D|oMenuCom|
|000038a0| 6d 61 6e 64 28 6d 65 6e | 75 52 65 73 75 6c 74 3a |mand(men|uResult:|
|000038b0| 20 4c 4f 4e 47 49 4e 54 | 29 3b 0d 0d 7b 54 68 69 | LONGINT|);..{Thi|
|000038c0| 73 20 69 73 20 63 61 6c | 6c 65 64 20 77 68 65 6e |s is cal|led when|
|000038d0| 20 61 6e 20 69 74 65 6d | 20 69 73 20 63 68 6f 73 | an item| is chos|
|000038e0| 65 6e 20 66 72 6f 6d 20 | 74 68 65 20 6d 65 6e 75 |en from |the menu|
|000038f0| 20 62 61 72 20 28 61 66 | 74 65 72 20 63 61 6c 6c | bar (af|ter call|
|00003900| 69 6e 67 0d 20 4d 65 6e | 75 53 65 6c 65 63 74 20 |ing. Men|uSelect |
|00003910| 6f 72 20 4d 65 6e 75 4b | 65 79 29 2e 20 49 74 20 |or MenuK|ey). It |
|00003920| 70 65 72 66 6f 72 6d 73 | 20 74 68 65 20 72 69 67 |performs| the rig|
|00003930| 68 74 20 6f 70 65 72 61 | 74 69 6f 6e 20 66 6f 72 |ht opera|tion for|
|00003940| 20 65 61 63 68 20 63 6f | 6d 6d 61 6e 64 2e 0d 20 | each co|mmand.. |
|00003950| 49 74 20 69 73 20 67 6f | 6f 64 20 74 6f 20 68 61 |It is go|od to ha|
|00003960| 76 65 20 62 6f 74 68 20 | 74 68 65 20 72 65 73 75 |ve both |the resu|
|00003970| 6c 74 20 6f 66 20 4d 65 | 6e 75 53 65 6c 65 63 74 |lt of Me|nuSelect|
|00003980| 20 61 6e 64 20 4d 65 6e | 75 4b 65 79 20 67 6f 20 | and Men|uKey go |
|00003990| 74 6f 0d 20 6f 6e 65 20 | 72 6f 75 74 69 6e 65 20 |to. one |routine |
|000039a0| 6c 69 6b 65 20 74 68 69 | 73 20 74 6f 20 6b 65 65 |like thi|s to kee|
|000039b0| 70 20 65 76 65 72 79 74 | 68 69 6e 67 20 6f 72 67 |p everyt|hing org|
|000039c0| 61 6e 69 7a 65 64 2e 7d | 0d 0d 56 41 52 0d 09 6d |anized.}|..VAR..m|
|000039d0| 65 6e 75 49 44 09 09 09 | 3a 20 49 4e 54 45 47 45 |enuID...|: INTEGE|
|000039e0| 52 3b 09 09 7b 74 68 65 | 20 72 65 73 6f 75 72 63 |R;..{the| resourc|
|000039f0| 65 20 49 44 20 6f 66 20 | 74 68 65 20 73 65 6c 65 |e ID of |the sele|
|00003a00| 63 74 65 64 20 6d 65 6e | 75 7d 0d 09 6d 65 6e 75 |cted men|u}..menu|
|00003a10| 49 74 65 6d 09 09 3a 20 | 49 4e 54 45 47 45 52 3b |Item..: |INTEGER;|
|00003a20| 09 09 7b 74 68 65 20 69 | 74 65 6d 20 6e 75 6d 62 |..{the i|tem numb|
|00003a30| 65 72 20 6f 66 20 74 68 | 65 20 73 65 6c 65 63 74 |er of th|e select|
|00003a40| 65 64 20 6d 65 6e 75 7d | 0d 09 69 74 65 6d 48 69 |ed menu}|..itemHi|
|00003a50| 74 09 09 09 3a 20 49 4e | 54 45 47 45 52 3b 0d 09 |t...: IN|TEGER;..|
|00003a60| 64 61 4e 61 6d 65 09 09 | 09 3a 20 53 74 72 32 35 |daName..|.: Str25|
|00003a70| 35 3b 0d 09 64 61 52 65 | 66 4e 75 6d 09 09 3a 20 |5;..daRe|fNum..: |
|00003a80| 49 4e 54 45 47 45 52 3b | 0d 09 68 61 6e 64 6c 65 |INTEGER;|..handle|
|00003a90| 64 42 79 44 41 09 09 3a | 20 42 4f 4f 4c 45 41 4e |dByDA..:| BOOLEAN|
|00003aa0| 3b 0d 0d 42 45 47 49 4e | 0d 09 6d 65 6e 75 49 44 |;..BEGIN|..menuID|
|00003ab0| 20 3a 3d 20 48 69 57 72 | 64 28 6d 65 6e 75 52 65 | := HiWr|d(menuRe|
|00003ac0| 73 75 6c 74 29 3b 09 7b | 75 73 65 20 62 75 69 6c |sult);.{|use buil|
|00003ad0| 74 2d 69 6e 73 20 28 66 | 6f 72 20 65 66 66 69 63 |t-ins (f|or effic|
|00003ae0| 69 65 6e 63 79 29 2e 2e | 2e 7d 0d 09 6d 65 6e 75 |iency)..|.}..menu|
|00003af0| 49 74 65 6d 20 3a 3d 20 | 4c 6f 57 72 64 28 6d 65 |Item := |LoWrd(me|
|00003b00| 6e 75 52 65 73 75 6c 74 | 29 3b 09 7b 74 6f 20 67 |nuResult|);.{to g|
|00003b10| 65 74 20 6d 65 6e 75 20 | 69 74 65 6d 20 6e 75 6d |et menu |item num|
|00003b20| 62 65 72 20 61 6e 64 20 | 6d 65 6e 75 20 6e 75 6d |ber and |menu num|
|00003b30| 62 65 72 7d 0d 09 43 41 | 53 45 20 6d 65 6e 75 49 |ber}..CA|SE menuI|
|00003b40| 44 20 4f 46 0d 09 09 6d | 41 70 70 6c 65 3a 0d 09 |D OF...m|Apple:..|
|00003b50| 09 09 43 41 53 45 20 6d | 65 6e 75 49 74 65 6d 20 |..CASE m|enuItem |
|00003b60| 4f 46 0d 09 09 09 09 69 | 41 62 6f 75 74 3a 09 09 |OF.....i|About:..|
|00003b70| 09 09 7b 62 72 69 6e 67 | 20 75 70 20 61 6c 65 72 |..{bring| up aler|
|00003b80| 74 20 66 6f 72 20 41 62 | 6f 75 74 7d 0d 09 09 09 |t for Ab|out}....|
|00003b90| 09 09 69 74 65 6d 48 69 | 74 20 3a 3d 20 41 6c 65 |..itemHi|t := Ale|
|00003ba0| 72 74 28 72 41 62 6f 75 | 74 41 6c 65 72 74 2c 20 |rt(rAbou|tAlert, |
|00003bb0| 4e 49 4c 29 3b 0d 09 09 | 09 09 4f 54 48 45 52 57 |NIL);...|..OTHERW|
|00003bc0| 49 53 45 20 42 45 47 49 | 4e 09 09 7b 61 6c 6c 20 |ISE BEGI|N..{all |
|00003bd0| 6e 6f 6e 2d 41 62 6f 75 | 74 20 69 74 65 6d 73 20 |non-Abou|t items |
|00003be0| 69 6e 20 74 68 69 73 20 | 6d 65 6e 75 20 61 72 65 |in this |menu are|
|00003bf0| 20 44 41 73 7d 0d 09 09 | 09 09 09 47 65 74 49 74 | DAs}...|...GetIt|
|00003c00| 65 6d 28 47 65 74 4d 48 | 61 6e 64 6c 65 28 6d 41 |em(GetMH|andle(mA|
|00003c10| 70 70 6c 65 29 2c 20 6d | 65 6e 75 49 74 65 6d 2c |pple), m|enuItem,|
|00003c20| 20 64 61 4e 61 6d 65 29 | 3b 0d 09 09 09 09 09 64 | daName)|;......d|
|00003c30| 61 52 65 66 4e 75 6d 20 | 3a 3d 20 4f 70 65 6e 44 |aRefNum |:= OpenD|
|00003c40| 65 73 6b 41 63 63 28 64 | 61 4e 61 6d 65 29 3b 0d |eskAcc(d|aName);.|
|00003c50| 09 09 09 09 45 4e 44 3b | 0d 09 09 09 45 4e 44 3b |....END;|....END;|
|00003c60| 0d 09 09 6d 46 69 6c 65 | 3a 0d 09 09 09 43 41 53 |...mFile|:....CAS|
|00003c70| 45 20 6d 65 6e 75 49 74 | 65 6d 20 4f 46 0d 09 09 |E menuIt|em OF...|
|00003c80| 09 09 69 43 6c 6f 73 65 | 3a 0d 09 09 09 09 09 44 |..iClose|:......D|
|00003c90| 6f 43 6c 6f 73 65 57 69 | 6e 64 6f 77 28 46 72 6f |oCloseWi|ndow(Fro|
|00003ca0| 6e 74 57 69 6e 64 6f 77 | 29 3b 0d 09 09 09 09 69 |ntWindow|);.....i|
|00003cb0| 51 75 69 74 3a 0d 09 09 | 09 09 09 54 65 72 6d 69 |Quit:...|...Termi|
|00003cc0| 6e 61 74 65 3b 0d 09 09 | 09 45 4e 44 3b 0d 09 09 |nate;...|.END;...|
|00003cd0| 6d 45 64 69 74 3a 09 09 | 09 09 09 09 7b 63 61 6c |mEdit:..|....{cal|
|00003ce0| 6c 20 53 79 73 74 65 6d | 45 64 69 74 20 66 6f 72 |l System|Edit for|
|00003cf0| 20 44 41 20 65 64 69 74 | 69 6e 67 20 26 20 4d 75 | DA edit|ing & Mu|
|00003d00| 6c 74 69 46 69 6e 64 65 | 72 7d 0d 09 09 09 68 61 |ltiFinde|r}....ha|
|00003d10| 6e 64 6c 65 64 42 79 44 | 41 20 3a 3d 20 53 79 73 |ndledByD|A := Sys|
|00003d20| 74 65 6d 45 64 69 74 28 | 6d 65 6e 75 49 74 65 6d |temEdit(|menuItem|
|00003d30| 2d 31 29 3b 09 7b 73 69 | 6e 63 65 20 77 65 20 64 |-1);.{si|nce we d|
|00003d40| 6f 6e 27 74 20 64 6f 20 | 61 6e 79 20 65 64 69 74 |on't do |any edit|
|00003d50| 69 6e 67 7d 0d 09 09 6d | 4c 69 67 68 74 3a 0d 09 |ing}...m|Light:..|
|00003d60| 09 09 43 41 53 45 20 6d | 65 6e 75 49 74 65 6d 20 |..CASE m|enuItem |
|00003d70| 4f 46 0d 09 09 09 09 69 | 53 74 6f 70 3a 0d 09 09 |OF.....i|Stop:...|
|00003d80| 09 09 09 53 65 74 4c 69 | 67 68 74 28 46 72 6f 6e |...SetLi|ght(Fron|
|00003d90| 74 57 69 6e 64 6f 77 2c | 20 54 52 55 45 29 3b 0d |tWindow,| TRUE);.|
|00003da0| 09 09 09 09 69 47 6f 3a | 0d 09 09 09 09 09 53 65 |....iGo:|......Se|
|00003db0| 74 4c 69 67 68 74 28 46 | 72 6f 6e 74 57 69 6e 64 |tLight(F|rontWind|
|00003dc0| 6f 77 2c 20 46 41 4c 53 | 45 29 3b 0d 09 09 09 45 |ow, FALS|E);....E|
|00003dd0| 4e 44 3b 0d 09 45 4e 44 | 3b 0d 09 48 69 6c 69 74 |ND;..END|;..Hilit|
|00003de0| 65 4d 65 6e 75 28 30 29 | 3b 09 09 09 09 09 7b 75 |eMenu(0)|;.....{u|
|00003df0| 6e 68 69 67 68 6c 69 67 | 68 74 20 77 68 61 74 20 |nhighlig|ht what |
|00003e00| 4d 65 6e 75 53 65 6c 65 | 63 74 20 28 6f 72 20 4d |MenuSele|ct (or M|
|00003e10| 65 6e 75 4b 65 79 29 20 | 68 69 6c 69 74 65 64 7d |enuKey) |hilited}|
|00003e20| 0d 45 4e 44 3b 20 7b 44 | 6f 4d 65 6e 75 43 6f 6d |.END; {D|oMenuCom|
|00003e30| 6d 61 6e 64 7d 0d 0d 0d | 7b 24 53 20 4d 61 69 6e |mand}...|{$S Main|
|00003e40| 7d 0d 50 52 4f 43 45 44 | 55 52 45 20 44 72 61 77 |}.PROCED|URE Draw|
|00003e50| 57 69 6e 64 6f 77 28 77 | 69 6e 64 6f 77 3a 20 57 |Window(w|indow: W|
|00003e60| 69 6e 64 6f 77 50 74 72 | 29 3b 0d 0d 7b 44 72 61 |indowPtr|);..{Dra|
|00003e70| 77 20 74 68 65 20 63 6f | 6e 74 65 6e 74 73 20 6f |w the co|ntents o|
|00003e80| 66 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |f the ap|plicatio|
|00003e90| 6e 20 77 69 6e 64 6f 77 | 2e 20 57 65 20 64 6f 20 |n window|. We do |
|00003ea0| 73 6f 6d 65 20 64 72 61 | 77 69 6e 67 20 69 6e 20 |some dra|wing in |
|00003eb0| 63 6f 6c 6f 72 2c 20 75 | 73 69 6e 67 0d 20 43 6c |color, u|sing. Cl|
|00003ec0| 61 73 73 69 63 20 51 75 | 69 63 6b 44 72 61 77 27 |assic Qu|ickDraw'|
|00003ed0| 73 20 63 6f 6c 6f 72 20 | 63 61 70 61 62 69 6c 69 |s color |capabili|
|00003ee0| 74 69 65 73 2e 20 54 68 | 69 73 20 77 69 6c 6c 20 |ties. Th|is will |
|00003ef0| 62 65 20 62 6c 61 63 6b | 20 61 6e 64 20 77 68 69 |be black| and whi|
|00003f00| 74 65 20 6f 6e 20 6f 6c | 64 0d 20 6d 61 63 68 69 |te on ol|d. machi|
|00003f10| 6e 65 73 2c 20 62 75 74 | 20 63 6f 6c 6f 72 20 6f |nes, but| color o|
|00003f20| 6e 20 63 6f 6c 6f 72 20 | 6d 61 63 68 69 6e 65 73 |n color |machines|
|00003f30| 2e 20 41 74 20 74 68 69 | 73 20 70 6f 69 6e 74 2c |. At thi|s point,|
|00003f40| 20 74 68 65 20 77 69 6e | 64 6f 77 27 73 20 76 69 | the win|dow's vi|
|00003f50| 73 52 67 6e 20 69 73 0d | 20 73 65 74 20 74 6f 20 |sRgn is.| set to |
|00003f60| 61 6c 6c 6f 77 20 64 72 | 61 77 69 6e 67 20 6f 6e |allow dr|awing on|
|00003f70| 6c 79 20 77 68 65 72 65 | 20 69 74 20 6e 65 65 64 |ly where| it need|
|00003f80| 73 20 74 6f 20 62 65 20 | 64 6f 6e 65 2e 7d 0d 0d |s to be |done.}..|
|00003f90| 42 45 47 49 4e 0d 09 53 | 65 74 50 6f 72 74 28 77 |BEGIN..S|etPort(w|
|00003fa0| 69 6e 64 6f 77 29 3b 0d | 0d 09 45 72 61 73 65 52 |indow);.|..EraseR|
|00003fb0| 65 63 74 28 77 69 6e 64 | 6f 77 5e 2e 70 6f 72 74 |ect(wind|ow^.port|
|00003fc0| 52 65 63 74 29 3b 09 7b | 63 6c 65 61 72 20 6f 75 |Rect);.{|clear ou|
|00003fd0| 74 20 61 6e 79 20 67 61 | 72 62 61 67 65 20 74 68 |t any ga|rbage th|
|00003fe0| 61 74 20 6d 69 67 68 74 | 20 62 65 20 6c 65 66 74 |at might| be left|
|00003ff0| 20 62 65 68 69 6e 64 7d | 0d 09 49 46 20 67 53 74 | behind}|..IF gSt|
|00004000| 6f 70 70 65 64 20 54 48 | 45 4e 09 09 09 09 7b 64 |opped TH|EN....{d|
|00004010| 72 61 77 20 61 20 72 65 | 64 20 28 6f 72 20 77 68 |raw a re|d (or wh|
|00004020| 69 74 65 29 20 73 74 6f | 70 20 6c 69 67 68 74 7d |ite) sto|p light}|
|00004030| 0d 09 09 46 6f 72 65 43 | 6f 6c 6f 72 28 72 65 64 |...ForeC|olor(red|
|00004040| 43 6f 6c 6f 72 29 0d 09 | 45 4c 53 45 0d 09 09 46 |Color)..|ELSE...F|
|00004050| 6f 72 65 43 6f 6c 6f 72 | 28 77 68 69 74 65 43 6f |oreColor|(whiteCo|
|00004060| 6c 6f 72 29 3b 0d 09 50 | 61 69 6e 74 4f 76 61 6c |lor);..P|aintOval|
|00004070| 28 67 53 74 6f 70 52 65 | 63 74 29 3b 0d 09 46 6f |(gStopRe|ct);..Fo|
|00004080| 72 65 43 6f 6c 6f 72 28 | 62 6c 61 63 6b 43 6f 6c |reColor(|blackCol|
|00004090| 6f 72 29 3b 0d 09 46 72 | 61 6d 65 4f 76 61 6c 28 |or);..Fr|ameOval(|
|000040a0| 67 53 74 6f 70 52 65 63 | 74 29 3b 0d 09 49 46 20 |gStopRec|t);..IF |
|000040b0| 4e 4f 54 20 67 53 74 6f | 70 70 65 64 20 54 48 45 |NOT gSto|pped THE|
|000040c0| 4e 09 09 09 7b 64 72 61 | 77 20 61 20 67 72 65 65 |N...{dra|w a gree|
|000040d0| 6e 20 28 6f 72 20 77 68 | 69 74 65 29 20 67 6f 20 |n (or wh|ite) go |
|000040e0| 6c 69 67 68 74 7d 0d 09 | 09 46 6f 72 65 43 6f 6c |light}..|.ForeCol|
|000040f0| 6f 72 28 67 72 65 65 6e | 43 6f 6c 6f 72 29 0d 09 |or(green|Color)..|
|00004100| 45 4c 53 45 0d 09 09 46 | 6f 72 65 43 6f 6c 6f 72 |ELSE...F|oreColor|
|00004110| 28 77 68 69 74 65 43 6f | 6c 6f 72 29 3b 0d 09 50 |(whiteCo|lor);..P|
|00004120| 61 69 6e 74 4f 76 61 6c | 28 67 47 6f 52 65 63 74 |aintOval|(gGoRect|
|00004130| 29 3b 0d 09 46 6f 72 65 | 43 6f 6c 6f 72 28 62 6c |);..Fore|Color(bl|
|00004140| 61 63 6b 43 6f 6c 6f 72 | 29 3b 0d 09 46 72 61 6d |ackColor|);..Fram|
|00004150| 65 4f 76 61 6c 28 67 47 | 6f 52 65 63 74 29 3b 0d |eOval(gG|oRect);.|
|00004160| 45 4e 44 3b 20 7b 44 72 | 61 77 57 69 6e 64 6f 77 |END; {Dr|awWindow|
|00004170| 7d 0d 0d 0d 7b 24 53 20 | 4d 61 69 6e 7d 0d 50 52 |}...{$S |Main}.PR|
|00004180| 4f 43 45 44 55 52 45 20 | 44 6f 43 6f 6e 74 65 6e |OCEDURE |DoConten|
|00004190| 74 43 6c 69 63 6b 28 77 | 69 6e 64 6f 77 3a 20 57 |tClick(w|indow: W|
|000041a0| 69 6e 64 6f 77 50 74 72 | 3b 20 65 76 65 6e 74 3a |indowPtr|; event:|
|000041b0| 20 45 76 65 6e 74 52 65 | 63 6f 72 64 29 3b 0d 0d | EventRe|cord);..|
|000041c0| 7b 54 68 69 73 20 69 73 | 20 63 61 6c 6c 65 64 20 |{This is| called |
|000041d0| 77 68 65 6e 20 61 20 6d | 6f 75 73 65 2d 64 6f 77 |when a m|ouse-dow|
|000041e0| 6e 20 65 76 65 6e 74 20 | 6f 63 63 75 72 73 20 69 |n event |occurs i|
|000041f0| 6e 20 74 68 65 20 63 6f | 6e 74 65 6e 74 20 6f 66 |n the co|ntent of|
|00004200| 20 61 20 77 69 6e 64 6f | 77 2e 0d 20 4f 74 68 65 | a windo|w.. Othe|
|00004210| 72 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 73 20 6d |r applic|ations m|
|00004220| 69 67 68 74 20 77 61 6e | 74 20 74 6f 20 63 61 6c |ight wan|t to cal|
|00004230| 6c 20 46 69 6e 64 43 6f | 6e 74 72 6f 6c 2c 20 54 |l FindCo|ntrol, T|
|00004240| 45 43 6c 69 63 6b 2c 20 | 65 74 63 2e 2c 20 74 6f |EClick, |etc., to|
|00004250| 0d 20 66 75 72 74 68 65 | 72 20 70 72 6f 63 65 73 |. furthe|r proces|
|00004260| 73 20 74 68 65 20 63 6c | 69 63 6b 2e 7d 0d 0d 42 |s the cl|ick.}..B|
|00004270| 45 47 49 4e 0d 09 53 65 | 74 4c 69 67 68 74 28 77 |EGIN..Se|tLight(w|
|00004280| 69 6e 64 6f 77 2c 20 4e | 4f 54 20 67 53 74 6f 70 |indow, N|OT gStop|
|00004290| 70 65 64 29 3b 0d 45 4e | 44 3b 20 7b 44 6f 43 6f |ped);.EN|D; {DoCo|
|000042a0| 6e 74 65 6e 74 43 6c 69 | 63 6b 7d 0d 0d 0d 7b 24 |ntentCli|ck}...{$|
|000042b0| 53 20 4d 61 69 6e 7d 0d | 50 52 4f 43 45 44 55 52 |S Main}.|PROCEDUR|
|000042c0| 45 20 44 6f 55 70 64 61 | 74 65 28 77 69 6e 64 6f |E DoUpda|te(windo|
|000042d0| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 29 3b 0d 0d |w: Windo|wPtr);..|
|000042e0| 7b 54 68 69 73 20 69 73 | 20 63 61 6c 6c 65 64 20 |{This is| called |
|000042f0| 77 68 65 6e 20 61 6e 20 | 75 70 64 61 74 65 20 65 |when an |update e|
|00004300| 76 65 6e 74 20 69 73 20 | 72 65 63 65 69 76 65 64 |vent is |received|
|00004310| 20 66 6f 72 20 61 20 77 | 69 6e 64 6f 77 2e 0d 20 | for a w|indow.. |
|00004320| 49 74 20 63 61 6c 6c 73 | 20 44 72 61 77 57 69 6e |It calls| DrawWin|
|00004330| 64 6f 77 20 74 6f 20 64 | 72 61 77 20 74 68 65 20 |dow to d|raw the |
|00004340| 63 6f 6e 74 65 6e 74 73 | 20 6f 66 20 61 6e 20 61 |contents| of an a|
|00004350| 70 70 6c 69 63 61 74 69 | 6f 6e 20 77 69 6e 64 6f |pplicati|on windo|
|00004360| 77 2e 0d 20 41 73 20 61 | 6e 20 65 66 66 65 63 69 |w.. As a|n effeci|
|00004370| 65 6e 63 79 20 6d 65 61 | 73 75 72 65 20 74 68 61 |ency mea|sure tha|
|00004380| 74 20 64 6f 65 73 20 6e | 6f 74 20 68 61 76 65 20 |t does n|ot have |
|00004390| 74 6f 20 62 65 20 66 6f | 6c 6c 6f 77 65 64 2c 20 |to be fo|llowed, |
|000043a0| 69 74 0d 20 63 61 6c 6c | 73 20 74 68 65 20 64 72 |it. call|s the dr|
|000043b0| 61 77 69 6e 67 20 72 6f | 75 74 69 6e 65 20 6f 6e |awing ro|utine on|
|000043c0| 6c 79 20 69 66 20 74 68 | 65 20 76 69 73 52 67 6e |ly if th|e visRgn|
|000043d0| 20 69 73 20 6e 6f 6e 2d | 65 6d 70 74 79 2e 20 54 | is non-|empty. T|
|000043e0| 68 69 73 0d 20 77 69 6c | 6c 20 68 61 6e 64 6c 65 |his. wil|l handle|
|000043f0| 20 73 69 74 75 61 74 69 | 6f 6e 73 20 77 68 65 72 | situati|ons wher|
|00004400| 65 20 63 61 6c 63 75 6c | 61 74 69 6f 6e 73 20 66 |e calcul|ations f|
|00004410| 6f 72 20 64 72 61 77 69 | 6e 67 20 6f 72 20 64 72 |or drawi|ng or dr|
|00004420| 61 77 69 6e 67 0d 20 69 | 74 73 65 6c 66 20 69 73 |awing. i|tself is|
|00004430| 20 76 65 72 79 20 74 69 | 6d 65 2d 63 6f 6e 73 75 | very ti|me-consu|
|00004440| 6d 69 6e 67 2e 7d 0d 0d | 42 45 47 49 4e 0d 09 49 |ming.}..|BEGIN..I|
|00004450| 46 20 49 73 41 70 70 57 | 69 6e 64 6f 77 28 77 69 |F IsAppW|indow(wi|
|00004460| 6e 64 6f 77 29 20 54 48 | 45 4e 20 42 45 47 49 4e |ndow) TH|EN BEGIN|
|00004470| 0d 09 09 42 65 67 69 6e | 55 70 64 61 74 65 28 77 |...Begin|Update(w|
|00004480| 69 6e 64 6f 77 29 3b 09 | 09 09 09 09 7b 74 68 69 |indow);.|....{thi|
|00004490| 73 20 73 65 74 73 20 75 | 70 20 74 68 65 20 76 69 |s sets u|p the vi|
|000044a0| 73 52 67 6e 7d 0d 09 09 | 49 46 20 4e 4f 54 20 45 |sRgn}...|IF NOT E|
|000044b0| 6d 70 74 79 52 67 6e 28 | 77 69 6e 64 6f 77 5e 2e |mptyRgn(|window^.|
|000044c0| 76 69 73 52 67 6e 29 20 | 54 48 45 4e 09 7b 64 72 |visRgn) |THEN.{dr|
|000044d0| 61 77 20 69 66 20 75 70 | 64 61 74 69 6e 67 20 6e |aw if up|dating n|
|000044e0| 65 65 64 73 20 74 6f 20 | 62 65 20 64 6f 6e 65 7d |eeds to |be done}|
|000044f0| 0d 09 09 09 44 72 61 77 | 57 69 6e 64 6f 77 28 77 |....Draw|Window(w|
|00004500| 69 6e 64 6f 77 29 3b 0d | 09 09 45 6e 64 55 70 64 |indow);.|..EndUpd|
|00004510| 61 74 65 28 77 69 6e 64 | 6f 77 29 3b 0d 09 45 4e |ate(wind|ow);..EN|
|00004520| 44 3b 0d 45 4e 44 3b 20 | 7b 44 6f 55 70 64 61 74 |D;.END; |{DoUpdat|
|00004530| 65 7d 0d 0d 0d 7b 24 53 | 20 4d 61 69 6e 7d 0d 50 |e}...{$S| Main}.P|
|00004540| 52 4f 43 45 44 55 52 45 | 20 44 6f 41 63 74 69 76 |ROCEDURE| DoActiv|
|00004550| 61 74 65 28 77 69 6e 64 | 6f 77 3a 20 57 69 6e 64 |ate(wind|ow: Wind|
|00004560| 6f 77 50 74 72 3b 20 62 | 65 63 6f 6d 69 6e 67 41 |owPtr; b|ecomingA|
|00004570| 63 74 69 76 65 3a 20 42 | 4f 4f 4c 45 41 4e 29 3b |ctive: B|OOLEAN);|
|00004580| 0d 0d 7b 54 68 69 73 20 | 69 73 20 63 61 6c 6c 65 |..{This |is calle|
|00004590| 64 20 77 68 65 6e 20 61 | 20 77 69 6e 64 6f 77 20 |d when a| window |
|000045a0| 69 73 20 61 63 74 69 76 | 61 74 65 64 20 6f 72 20 |is activ|ated or |
|000045b0| 64 65 61 63 74 69 76 61 | 74 65 64 2e 0d 20 49 6e |deactiva|ted.. In|
|000045c0| 20 53 61 6d 70 6c 65 2c | 20 74 68 65 20 57 69 6e | Sample,| the Win|
|000045d0| 64 6f 77 20 4d 61 6e 61 | 67 65 72 27 73 20 68 61 |dow Mana|ger's ha|
|000045e0| 6e 64 6c 69 6e 67 20 6f | 66 20 61 63 74 69 76 61 |ndling o|f activa|
|000045f0| 74 65 20 61 6e 64 0d 20 | 64 65 61 63 74 69 76 61 |te and. |deactiva|
|00004600| 74 65 20 65 76 65 6e 74 | 73 20 69 73 20 73 75 66 |te event|s is suf|
|00004610| 66 69 63 69 65 6e 74 2e | 20 4f 74 68 65 72 20 61 |ficient.| Other a|
|00004620| 70 70 6c 69 63 61 74 69 | 6f 6e 73 20 6d 61 79 20 |pplicati|ons may |
|00004630| 68 61 76 65 0d 20 54 65 | 78 74 45 64 69 74 20 72 |have. Te|xtEdit r|
|00004640| 65 63 6f 72 64 73 2c 20 | 63 6f 6e 74 72 6f 6c 73 |ecords, |controls|
|00004650| 2c 20 6c 69 73 74 73 2c | 20 65 74 63 2e 2c 20 74 |, lists,| etc., t|
|00004660| 6f 20 61 63 74 69 76 61 | 74 65 2f 64 65 61 63 74 |o activa|te/deact|
|00004670| 69 76 61 74 65 2e 7d 0d | 0d 42 45 47 49 4e 0d 09 |ivate.}.|.BEGIN..|
|00004680| 49 46 20 49 73 41 70 70 | 57 69 6e 64 6f 77 28 77 |IF IsApp|Window(w|
|00004690| 69 6e 64 6f 77 29 20 54 | 48 45 4e 0d 09 09 49 46 |indow) T|HEN...IF|
|000046a0| 20 62 65 63 6f 6d 69 6e | 67 41 63 74 69 76 65 20 | becomin|gActive |
|000046b0| 54 48 45 4e 0d 09 09 09 | 7b 64 6f 20 77 68 61 74 |THEN....|{do what|
|000046c0| 65 76 65 72 20 79 6f 75 | 20 6e 65 65 64 20 74 6f |ever you| need to|
|000046d0| 20 61 74 20 61 63 74 69 | 76 61 74 69 6f 6e 7d 0d | at acti|vation}.|
|000046e0| 09 09 45 4c 53 45 0d 09 | 09 09 7b 64 6f 20 77 68 |..ELSE..|..{do wh|
|000046f0| 61 74 65 76 65 72 20 79 | 6f 75 20 6e 65 65 64 20 |atever y|ou need |
|00004700| 74 6f 20 61 74 20 64 65 | 61 63 74 69 76 61 74 69 |to at de|activati|
|00004710| 6f 6e 7d 3b 0d 45 4e 44 | 3b 20 7b 44 6f 41 63 74 |on};.END|; {DoAct|
|00004720| 69 76 61 74 65 7d 0d 0d | 0d 7b 24 53 20 4d 61 69 |ivate}..|.{$S Mai|
|00004730| 6e 7d 0d 50 52 4f 43 45 | 44 55 52 45 20 41 64 6a |n}.PROCE|DURE Adj|
|00004740| 75 73 74 43 75 72 73 6f | 72 28 6d 6f 75 73 65 3a |ustCurso|r(mouse:|
|00004750| 20 50 6f 69 6e 74 3b 20 | 72 65 67 69 6f 6e 3a 20 | Point; |region: |
|00004760| 52 67 6e 48 61 6e 64 6c | 65 29 3b 0d 0d 7b 43 68 |RgnHandl|e);..{Ch|
|00004770| 61 6e 67 65 20 74 68 65 | 20 63 75 72 73 6f 72 27 |ange the| cursor'|
|00004780| 73 20 73 68 61 70 65 2c | 20 64 65 70 65 6e 64 69 |s shape,| dependi|
|00004790| 6e 67 20 6f 6e 20 69 74 | 73 20 70 6f 73 69 74 69 |ng on it|s positi|
|000047a0| 6f 6e 2e 20 54 68 69 73 | 20 61 6c 73 6f 20 63 61 |on. This| also ca|
|000047b0| 6c 63 75 6c 61 74 65 73 | 20 74 68 65 20 72 65 67 |lculates| the reg|
|000047c0| 69 6f 6e 0d 20 77 68 65 | 72 65 20 74 68 65 20 63 |ion. whe|re the c|
|000047d0| 75 72 72 65 6e 74 20 63 | 75 72 73 6f 72 20 72 65 |urrent c|ursor re|
|000047e0| 73 69 64 65 73 20 28 66 | 6f 72 20 57 61 69 74 4e |sides (f|or WaitN|
|000047f0| 65 78 74 45 76 65 6e 74 | 29 2e 20 49 66 20 74 68 |extEvent|). If th|
|00004800| 65 20 6d 6f 75 73 65 20 | 69 73 20 65 76 65 72 20 |e mouse |is ever |
|00004810| 6f 75 74 73 69 64 65 20 | 6f 66 0d 20 74 68 61 74 |outside |of. that|
|00004820| 20 72 65 67 69 6f 6e 2c | 20 61 6e 20 65 76 65 6e | region,| an even|
|00004830| 74 20 77 6f 75 6c 64 20 | 62 65 20 67 65 6e 65 72 |t would |be gener|
|00004840| 61 74 65 64 2c 20 63 61 | 75 73 69 6e 67 20 74 68 |ated, ca|using th|
|00004850| 69 73 20 72 6f 75 74 69 | 6e 65 20 74 6f 20 62 65 |is routi|ne to be|
|00004860| 20 63 61 6c 6c 65 64 2c | 0d 20 61 6c 6c 6f 77 69 | called,|. allowi|
|00004870| 6e 67 20 75 73 20 74 6f | 20 63 68 61 6e 67 65 20 |ng us to| change |
|00004880| 74 68 65 20 72 65 67 69 | 6f 6e 20 74 6f 20 74 68 |the regi|on to th|
|00004890| 65 20 72 65 67 69 6f 6e | 20 74 68 65 20 6d 6f 75 |e region| the mou|
|000048a0| 73 65 20 69 73 20 63 75 | 72 72 65 6e 74 6c 79 20 |se is cu|rrently |
|000048b0| 69 6e 2e 20 49 66 0d 20 | 74 68 65 72 65 20 69 73 |in. If. |there is|
|000048c0| 20 6d 6f 72 65 20 74 6f | 20 74 68 65 20 65 76 65 | more to| the eve|
|000048d0| 6e 74 20 74 68 61 6e 20 | 6a 75 73 74 20 d2 74 68 |nt than |just .th|
|000048e0| 65 20 6d 6f 75 73 65 20 | 6d 6f 76 65 64 d3 2c 20 |e mouse |moved., |
|000048f0| 77 65 20 67 65 74 20 63 | 61 6c 6c 65 64 20 62 65 |we get c|alled be|
|00004900| 66 6f 72 65 20 74 68 65 | 0d 20 65 76 65 6e 74 20 |fore the|. event |
|00004910| 69 73 20 70 72 6f 63 65 | 73 73 65 64 20 74 6f 20 |is proce|ssed to |
|00004920| 6d 61 6b 65 20 73 75 72 | 65 20 74 68 65 20 63 75 |make sur|e the cu|
|00004930| 72 73 6f 72 20 69 73 20 | 74 68 65 20 72 69 67 68 |rsor is |the righ|
|00004940| 74 20 6f 6e 65 2e 20 49 | 6e 20 61 6e 79 20 28 61 |t one. I|n any (a|
|00004950| 68 65 6d 29 20 65 76 65 | 6e 74 2c 0d 20 74 68 69 |hem) eve|nt,. thi|
|00004960| 73 20 69 73 20 63 61 6c | 6c 65 64 20 61 67 61 69 |s is cal|led agai|
|00004970| 6e 20 62 65 66 6f 72 65 | 20 77 65 20 66 61 6c 6c |n before| we fall|
|00004980| 20 62 61 63 6b 20 69 6e | 74 6f 20 57 4e 45 2e 7d | back in|to WNE.}|
|00004990| 0d 0d 56 41 52 0d 09 77 | 69 6e 64 6f 77 09 09 09 |..VAR..w|indow...|
|000049a0| 09 3a 20 57 69 6e 64 6f | 77 50 74 72 3b 0d 09 61 |.: Windo|wPtr;..a|
|000049b0| 72 72 6f 77 52 67 6e 09 | 09 09 3a 20 52 67 6e 48 |rrowRgn.|..: RgnH|
|000049c0| 61 6e 64 6c 65 3b 0d 09 | 70 6c 75 73 52 67 6e 09 |andle;..|plusRgn.|
|000049d0| 09 09 09 3a 20 52 67 6e | 48 61 6e 64 6c 65 3b 0d |...: Rgn|Handle;.|
|000049e0| 09 67 6c 6f 62 61 6c 50 | 6f 72 74 52 65 63 74 09 |.globalP|ortRect.|
|000049f0| 09 3a 20 52 65 63 74 3b | 0d 0d 42 45 47 49 4e 0d |.: Rect;|..BEGIN.|
|00004a00| 09 77 69 6e 64 6f 77 20 | 3a 3d 20 46 72 6f 6e 74 |.window |:= Front|
|00004a10| 57 69 6e 64 6f 77 3b 09 | 7b 77 65 20 6f 6e 6c 79 |Window;.|{we only|
|00004a20| 20 61 64 6a 75 73 74 20 | 74 68 65 20 63 75 72 73 | adjust |the curs|
|00004a30| 6f 72 20 77 68 65 6e 20 | 77 65 20 61 72 65 20 69 |or when |we are i|
|00004a40| 6e 20 66 72 6f 6e 74 7d | 0d 09 49 46 20 28 4e 4f |n front}|..IF (NO|
|00004a50| 54 20 67 49 6e 42 61 63 | 6b 67 72 6f 75 6e 64 29 |T gInBac|kground)|
|00004a60| 20 41 4e 44 20 28 4e 4f | 54 20 49 73 44 41 57 69 | AND (NO|T IsDAWi|
|00004a70| 6e 64 6f 77 28 77 69 6e | 64 6f 77 29 29 20 54 48 |ndow(win|dow)) TH|
|00004a80| 45 4e 20 42 45 47 49 4e | 0d 09 09 7b 63 61 6c 63 |EN BEGIN|...{calc|
|00004a90| 75 6c 61 74 65 20 72 65 | 67 69 6f 6e 73 20 66 6f |ulate re|gions fo|
|00004aa0| 72 20 64 69 66 66 65 72 | 65 6e 74 20 63 75 72 73 |r differ|ent curs|
|00004ab0| 6f 72 20 73 68 61 70 65 | 73 7d 0d 09 09 61 72 72 |or shape|s}...arr|
|00004ac0| 6f 77 52 67 6e 20 3a 3d | 20 4e 65 77 52 67 6e 3b |owRgn :=| NewRgn;|
|00004ad0| 0d 09 09 70 6c 75 73 52 | 67 6e 20 3a 3d 20 4e 65 |...plusR|gn := Ne|
|00004ae0| 77 52 67 6e 3b 0d 0d 09 | 09 7b 73 74 61 72 74 20 |wRgn;...|.{start |
|00004af0| 77 69 74 68 20 61 20 62 | 69 67 2c 20 62 69 67 20 |with a b|ig, big |
|00004b00| 72 65 63 74 61 6e 67 75 | 6c 61 72 20 72 65 67 69 |rectangu|lar regi|
|00004b10| 6f 6e 7d 0d 09 09 53 65 | 74 52 65 63 74 52 67 6e |on}...Se|tRectRgn|
|00004b20| 28 61 72 72 6f 77 52 67 | 6e 2c 20 65 78 74 72 65 |(arrowRg|n, extre|
|00004b30| 6d 65 4e 65 67 2c 20 65 | 78 74 72 65 6d 65 4e 65 |meNeg, e|xtremeNe|
|00004b40| 67 2c 20 65 78 74 72 65 | 6d 65 50 6f 73 2c 20 65 |g, extre|mePos, e|
|00004b50| 78 74 72 65 6d 65 50 6f | 73 29 3b 0d 0d 09 09 7b |xtremePo|s);....{|
|00004b60| 63 61 6c 63 75 6c 61 74 | 65 20 70 6c 75 73 52 67 |calculat|e plusRg|
|00004b70| 6e 7d 0d 09 09 49 46 20 | 49 73 41 70 70 57 69 6e |n}...IF |IsAppWin|
|00004b80| 64 6f 77 28 77 69 6e 64 | 6f 77 29 20 54 48 45 4e |dow(wind|ow) THEN|
|00004b90| 20 42 45 47 49 4e 0d 09 | 09 09 53 65 74 50 6f 72 | BEGIN..|..SetPor|
|00004ba0| 74 28 77 69 6e 64 6f 77 | 29 3b 09 09 09 7b 6d 61 |t(window|);...{ma|
|00004bb0| 6b 65 20 61 20 67 6c 6f | 62 61 6c 20 76 65 72 73 |ke a glo|bal vers|
|00004bc0| 69 6f 6e 20 6f 66 20 74 | 68 65 20 70 6f 72 74 52 |ion of t|he portR|
|00004bd0| 65 63 74 7d 0d 09 09 09 | 53 65 74 4f 72 69 67 69 |ect}....|SetOrigi|
|00004be0| 6e 28 2d 77 69 6e 64 6f | 77 5e 2e 70 6f 72 74 42 |n(-windo|w^.portB|
|00004bf0| 69 74 73 2e 62 6f 75 6e | 64 73 2e 6c 65 66 74 2c |its.boun|ds.left,|
|00004c00| 20 2d 77 69 6e 64 6f 77 | 5e 2e 70 6f 72 74 42 69 | -window|^.portBi|
|00004c10| 74 73 2e 62 6f 75 6e 64 | 73 2e 74 6f 70 29 3b 0d |ts.bound|s.top);.|
|00004c20| 09 09 09 67 6c 6f 62 61 | 6c 50 6f 72 74 52 65 63 |...globa|lPortRec|
|00004c30| 74 20 3a 3d 20 77 69 6e | 64 6f 77 5e 2e 70 6f 72 |t := win|dow^.por|
|00004c40| 74 52 65 63 74 3b 0d 09 | 09 09 52 65 63 74 52 67 |tRect;..|..RectRg|
|00004c50| 6e 28 70 6c 75 73 52 67 | 6e 2c 20 67 6c 6f 62 61 |n(plusRg|n, globa|
|00004c60| 6c 50 6f 72 74 52 65 63 | 74 29 3b 0d 09 09 09 53 |lPortRec|t);....S|
|00004c70| 65 63 74 52 67 6e 28 70 | 6c 75 73 52 67 6e 2c 20 |ectRgn(p|lusRgn, |
|00004c80| 77 69 6e 64 6f 77 5e 2e | 76 69 73 52 67 6e 2c 20 |window^.|visRgn, |
|00004c90| 70 6c 75 73 52 67 6e 29 | 3b 0d 09 09 09 53 65 74 |plusRgn)|;....Set|
|00004ca0| 4f 72 69 67 69 6e 28 30 | 2c 20 30 29 3b 0d 09 09 |Origin(0|, 0);...|
|00004cb0| 45 4e 44 3b 0d 0d 09 09 | 7b 73 75 62 74 72 61 63 |END;....|{subtrac|
|00004cc0| 74 20 6f 74 68 65 72 20 | 72 65 67 69 6f 6e 73 20 |t other |regions |
|00004cd0| 66 72 6f 6d 20 61 72 72 | 6f 77 52 67 6e 7d 0d 09 |from arr|owRgn}..|
|00004ce0| 09 44 69 66 66 52 67 6e | 28 61 72 72 6f 77 52 67 |.DiffRgn|(arrowRg|
|00004cf0| 6e 2c 20 70 6c 75 73 52 | 67 6e 2c 20 61 72 72 6f |n, plusR|gn, arro|
|00004d00| 77 52 67 6e 29 3b 0d 0d | 09 09 7b 63 68 61 6e 67 |wRgn);..|..{chang|
|00004d10| 65 20 74 68 65 20 63 75 | 72 73 6f 72 20 61 6e 64 |e the cu|rsor and|
|00004d20| 20 74 68 65 20 72 65 67 | 69 6f 6e 20 70 61 72 61 | the reg|ion para|
|00004d30| 6d 65 74 65 72 7d 0d 09 | 09 49 46 20 50 74 49 6e |meter}..|.IF PtIn|
|00004d40| 52 67 6e 28 6d 6f 75 73 | 65 2c 20 70 6c 75 73 52 |Rgn(mous|e, plusR|
|00004d50| 67 6e 29 20 54 48 45 4e | 20 42 45 47 49 4e 0d 09 |gn) THEN| BEGIN..|
|00004d60| 09 09 53 65 74 43 75 72 | 73 6f 72 28 47 65 74 43 |..SetCur|sor(GetC|
|00004d70| 75 72 73 6f 72 28 70 6c | 75 73 43 75 72 73 6f 72 |ursor(pl|usCursor|
|00004d80| 29 5e 5e 29 3b 0d 09 09 | 09 43 6f 70 79 52 67 6e |)^^);...|.CopyRgn|
|00004d90| 28 70 6c 75 73 52 67 6e | 2c 20 72 65 67 69 6f 6e |(plusRgn|, region|
|00004da0| 29 3b 0d 09 09 45 4e 44 | 20 45 4c 53 45 20 42 45 |);...END| ELSE BE|
|00004db0| 47 49 4e 0d 09 09 09 53 | 65 74 43 75 72 73 6f 72 |GIN....S|etCursor|
|00004dc0| 28 61 72 72 6f 77 29 3b | 0d 09 09 09 43 6f 70 79 |(arrow);|....Copy|
|00004dd0| 52 67 6e 28 61 72 72 6f | 77 52 67 6e 2c 20 72 65 |Rgn(arro|wRgn, re|
|00004de0| 67 69 6f 6e 29 3b 0d 09 | 09 45 4e 44 3b 0d 0d 09 |gion);..|.END;...|
|00004df0| 09 7b 67 65 74 20 72 69 | 64 20 6f 66 20 6f 75 72 |.{get ri|d of our|
|00004e00| 20 6c 6f 63 61 6c 20 72 | 65 67 69 6f 6e 73 7d 0d | local r|egions}.|
|00004e10| 09 09 44 69 73 70 6f 73 | 65 52 67 6e 28 61 72 72 |..Dispos|eRgn(arr|
|00004e20| 6f 77 52 67 6e 29 3b 0d | 09 09 44 69 73 70 6f 73 |owRgn);.|..Dispos|
|00004e30| 65 52 67 6e 28 70 6c 75 | 73 52 67 6e 29 3b 0d 09 |eRgn(plu|sRgn);..|
|00004e40| 45 4e 44 3b 0d 45 4e 44 | 3b 20 7b 41 64 6a 75 73 |END;.END|; {Adjus|
|00004e50| 74 43 75 72 73 6f 72 7d | 0d 0d 0d 7b 24 53 20 4d |tCursor}|...{$S M|
|00004e60| 61 69 6e 7d 0d 50 52 4f | 43 45 44 55 52 45 20 44 |ain}.PRO|CEDURE D|
|00004e70| 6f 45 76 65 6e 74 28 65 | 76 65 6e 74 3a 20 45 76 |oEvent(e|vent: Ev|
|00004e80| 65 6e 74 52 65 63 6f 72 | 64 29 3b 0d 0d 7b 44 6f |entRecor|d);..{Do|
|00004e90| 20 74 68 65 20 72 69 67 | 68 74 20 74 68 69 6e 67 | the rig|ht thing|
|00004ea0| 20 66 6f 72 20 61 6e 20 | 65 76 65 6e 74 2e 20 44 | for an |event. D|
|00004eb0| 65 74 65 72 6d 69 6e 65 | 20 77 68 61 74 20 6b 69 |etermine| what ki|
|00004ec0| 6e 64 20 6f 66 20 65 76 | 65 6e 74 20 69 74 20 69 |nd of ev|ent it i|
|00004ed0| 73 2c 20 61 6e 64 20 63 | 61 6c 6c 0d 20 74 68 65 |s, and c|all. the|
|00004ee0| 20 61 70 70 72 6f 70 72 | 69 61 74 65 20 72 6f 75 | appropr|iate rou|
|00004ef0| 74 69 6e 65 73 2e 7d 0d | 0d 56 41 52 0d 09 70 61 |tines.}.|.VAR..pa|
|00004f00| 72 74 09 3a 20 49 4e 54 | 45 47 45 52 3b 0d 09 77 |rt.: INT|EGER;..w|
|00004f10| 69 6e 64 6f 77 09 3a 20 | 57 69 6e 64 6f 77 50 74 |indow.: |WindowPt|
|00004f20| 72 3b 0d 09 68 69 74 09 | 09 3a 20 42 4f 4f 4c 45 |r;..hit.|.: BOOLE|
|00004f30| 41 4e 3b 0d 09 6b 65 79 | 09 09 3a 20 43 48 41 52 |AN;..key|..: CHAR|
|00004f40| 3b 0d 0d 42 45 47 49 4e | 0d 09 43 41 53 45 20 65 |;..BEGIN|..CASE e|
|00004f50| 76 65 6e 74 2e 77 68 61 | 74 20 4f 46 0d 09 09 6d |vent.wha|t OF...m|
|00004f60| 6f 75 73 65 44 6f 77 6e | 3a 20 42 45 47 49 4e 0d |ouseDown|: BEGIN.|
|00004f70| 09 09 09 70 61 72 74 20 | 3a 3d 20 46 69 6e 64 57 |...part |:= FindW|
|00004f80| 69 6e 64 6f 77 28 65 76 | 65 6e 74 2e 77 68 65 72 |indow(ev|ent.wher|
|00004f90| 65 2c 20 77 69 6e 64 6f | 77 29 3b 0d 09 09 09 43 |e, windo|w);....C|
|00004fa0| 41 53 45 20 70 61 72 74 | 20 4f 46 0d 09 09 09 09 |ASE part| OF.....|
|00004fb0| 69 6e 4d 65 6e 75 42 61 | 72 3a 20 42 45 47 49 4e |inMenuBa|r: BEGIN|
|00004fc0| 09 09 09 7b 70 72 6f 63 | 65 73 73 20 74 68 65 20 |...{proc|ess the |
|00004fd0| 6d 65 6e 75 20 63 6f 6d | 6d 61 6e 64 7d 0d 09 09 |menu com|mand}...|
|00004fe0| 09 09 09 41 64 6a 75 73 | 74 4d 65 6e 75 73 3b 0d |...Adjus|tMenus;.|
|00004ff0| 09 09 09 09 09 44 6f 4d | 65 6e 75 43 6f 6d 6d 61 |.....DoM|enuComma|
|00005000| 6e 64 28 4d 65 6e 75 53 | 65 6c 65 63 74 28 65 76 |nd(MenuS|elect(ev|
|00005010| 65 6e 74 2e 77 68 65 72 | 65 29 29 3b 0d 09 09 09 |ent.wher|e));....|
|00005020| 09 45 4e 44 3b 0d 09 09 | 09 09 69 6e 53 79 73 57 |.END;...|..inSysW|
|00005030| 69 6e 64 6f 77 3a 09 09 | 09 09 7b 6c 65 74 20 74 |indow:..|..{let t|
|00005040| 68 65 20 73 79 73 74 65 | 6d 20 68 61 6e 64 6c 65 |he syste|m handle|
|00005050| 20 74 68 65 20 6d 6f 75 | 73 65 44 6f 77 6e 7d 0d | the mou|seDown}.|
|00005060| 09 09 09 09 09 53 79 73 | 74 65 6d 43 6c 69 63 6b |.....Sys|temClick|
|00005070| 28 65 76 65 6e 74 2c 20 | 77 69 6e 64 6f 77 29 3b |(event, |window);|
|00005080| 0d 09 09 09 09 69 6e 43 | 6f 6e 74 65 6e 74 3a 0d |.....inC|ontent:.|
|00005090| 09 09 09 09 09 49 46 20 | 77 69 6e 64 6f 77 20 3c |.....IF |window <|
|000050a0| 3e 20 46 72 6f 6e 74 57 | 69 6e 64 6f 77 20 54 48 |> FrontW|indow TH|
|000050b0| 45 4e 20 42 45 47 49 4e | 0d 09 09 09 09 09 09 53 |EN BEGIN|.......S|
|000050c0| 65 6c 65 63 74 57 69 6e | 64 6f 77 28 77 69 6e 64 |electWin|dow(wind|
|000050d0| 6f 77 29 3b 0d 09 09 09 | 09 09 09 7b 44 6f 45 76 |ow);....|...{DoEv|
|000050e0| 65 6e 74 28 65 76 65 6e | 74 29 3b 7d 09 7b 75 73 |ent(even|t);}.{us|
|000050f0| 65 20 74 68 69 73 20 6c | 69 6e 65 20 66 6f 72 20 |e this l|ine for |
|00005100| 22 64 6f 20 66 69 72 73 | 74 20 63 6c 69 63 6b 22 |"do firs|t click"|
|00005110| 7d 0d 09 09 09 09 09 45 | 4e 44 20 45 4c 53 45 0d |}......E|ND ELSE.|
|00005120| 09 09 09 09 09 09 44 6f | 43 6f 6e 74 65 6e 74 43 |......Do|ContentC|
|00005130| 6c 69 63 6b 28 77 69 6e | 64 6f 77 2c 20 65 76 65 |lick(win|dow, eve|
|00005140| 6e 74 29 3b 0d 09 09 09 | 09 69 6e 44 72 61 67 3a |nt);....|.inDrag:|
|00005150| 09 09 09 09 09 09 7b 70 | 61 73 73 20 73 63 72 65 |......{p|ass scre|
|00005160| 65 6e 42 69 74 73 2e 62 | 6f 75 6e 64 73 20 74 6f |enBits.b|ounds to|
|00005170| 20 67 65 74 20 61 6c 6c | 20 67 44 65 76 69 63 65 | get all| gDevice|
|00005180| 73 7d 0d 09 09 09 09 09 | 44 72 61 67 57 69 6e 64 |s}......|DragWind|
|00005190| 6f 77 28 77 69 6e 64 6f | 77 2c 20 65 76 65 6e 74 |ow(windo|w, event|
|000051a0| 2e 77 68 65 72 65 2c 20 | 73 63 72 65 65 6e 42 69 |.where, |screenBi|
|000051b0| 74 73 2e 62 6f 75 6e 64 | 73 29 3b 0d 09 09 09 09 |ts.bound|s);.....|
|000051c0| 69 6e 47 72 6f 77 3a 3b | 0d 09 09 09 09 69 6e 5a |inGrow:;|.....inZ|
|000051d0| 6f 6f 6d 49 6e 2c 20 69 | 6e 5a 6f 6f 6d 4f 75 74 |oomIn, i|nZoomOut|
|000051e0| 3a 3b 0d 09 09 09 45 4e | 44 3b 0d 09 09 45 4e 44 |:;....EN|D;...END|
|000051f0| 3b 0d 09 09 6b 65 79 44 | 6f 77 6e 2c 20 61 75 74 |;...keyD|own, aut|
|00005200| 6f 4b 65 79 3a 20 42 45 | 47 49 4e 09 09 09 09 7b |oKey: BE|GIN....{|
|00005210| 63 68 65 63 6b 20 66 6f | 72 20 6d 65 6e 75 6b 65 |check fo|r menuke|
|00005220| 79 20 65 71 75 69 76 61 | 6c 65 6e 74 73 7d 0d 09 |y equiva|lents}..|
|00005230| 09 09 6b 65 79 20 3a 3d | 20 43 48 52 28 42 41 6e |..key :=| CHR(BAn|
|00005240| 64 28 65 76 65 6e 74 2e | 6d 65 73 73 61 67 65 2c |d(event.|message,|
|00005250| 20 63 68 61 72 43 6f 64 | 65 4d 61 73 6b 29 29 3b | charCod|eMask));|
|00005260| 0d 09 09 09 49 46 20 42 | 41 6e 64 28 65 76 65 6e |....IF B|And(even|
|00005270| 74 2e 6d 6f 64 69 66 69 | 65 72 73 2c 20 63 6d 64 |t.modifi|ers, cmd|
|00005280| 4b 65 79 29 20 3c 3e 20 | 30 20 54 48 45 4e 09 7b |Key) <> |0 THEN.{|
|00005290| 43 6f 6d 6d 61 6e 64 20 | 6b 65 79 20 64 6f 77 6e |Command |key down|
|000052a0| 7d 0d 09 09 09 09 49 46 | 20 65 76 65 6e 74 2e 77 |}.....IF| event.w|
|000052b0| 68 61 74 20 3d 20 6b 65 | 79 44 6f 77 6e 20 54 48 |hat = ke|yDown TH|
|000052c0| 45 4e 20 42 45 47 49 4e | 0d 09 09 09 09 09 41 64 |EN BEGIN|......Ad|
|000052d0| 6a 75 73 74 4d 65 6e 75 | 73 3b 09 09 09 7b 65 6e |justMenu|s;...{en|
|000052e0| 61 62 6c 65 2f 64 69 73 | 61 62 6c 65 2f 63 68 65 |able/dis|able/che|
|000052f0| 63 6b 20 6d 65 6e 75 20 | 69 74 65 6d 73 20 70 72 |ck menu |items pr|
|00005300| 6f 70 65 72 6c 79 7d 0d | 09 09 09 09 09 44 6f 4d |operly}.|.....DoM|
|00005310| 65 6e 75 43 6f 6d 6d 61 | 6e 64 28 4d 65 6e 75 4b |enuComma|nd(MenuK|
|00005320| 65 79 28 6b 65 79 29 29 | 3b 0d 09 09 09 09 45 4e |ey(key))|;.....EN|
|00005330| 44 3b 0d 09 09 45 4e 44 | 3b 20 20 20 20 20 20 20 |D;...END|; |
|00005340| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005350| 20 20 20 20 20 20 20 20 | 20 7b 63 61 6c 6c 20 44 | | {call D|
|00005360| 6f 41 63 74 69 76 61 74 | 65 20 77 69 74 68 20 74 |oActivat|e with t|
|00005370| 68 65 20 77 69 6e 64 6f | 77 20 61 6e 64 2e 2e 2e |he windo|w and...|
|00005380| 7d 0d 09 09 61 63 74 69 | 76 61 74 65 45 76 74 3a |}...acti|vateEvt:|
|00005390| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000053a0| 20 20 20 20 20 20 20 20 | 7b 54 52 55 45 20 66 6f | |{TRUE fo|
|000053b0| 72 20 61 63 74 69 76 61 | 74 65 2c 20 46 41 4c 53 |r activa|te, FALS|
|000053c0| 45 20 66 6f 72 20 64 65 | 61 63 74 69 76 61 74 65 |E for de|activate|
|000053d0| 7d 0d 09 09 09 44 6f 41 | 63 74 69 76 61 74 65 28 |}....DoA|ctivate(|
|000053e0| 57 69 6e 64 6f 77 50 74 | 72 28 65 76 65 6e 74 2e |WindowPt|r(event.|
|000053f0| 6d 65 73 73 61 67 65 29 | 2c 20 42 41 6e 64 28 65 |message)|, BAnd(e|
|00005400| 76 65 6e 74 2e 6d 6f 64 | 69 66 69 65 72 73 2c 20 |vent.mod|ifiers, |
|00005410| 61 63 74 69 76 65 46 6c | 61 67 29 20 3c 3e 20 30 |activeFl|ag) <> 0|
|00005420| 29 3b 0d 09 09 75 70 64 | 61 74 65 45 76 74 3a 20 |);...upd|ateEvt: |
|00005430| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005440| 20 20 20 20 20 20 20 20 | 20 7b 63 61 6c 6c 20 44 | | {call D|
|00005450| 6f 55 70 64 61 74 65 20 | 77 69 74 68 20 74 68 65 |oUpdate |with the|
|00005460| 20 77 69 6e 64 6f 77 20 | 74 6f 20 75 70 64 61 74 | window |to updat|
|00005470| 65 7d 0d 09 09 09 44 6f | 55 70 64 61 74 65 28 57 |e}....Do|Update(W|
|00005480| 69 6e 64 6f 77 50 74 72 | 28 65 76 65 6e 74 2e 6d |indowPtr|(event.m|
|00005490| 65 73 73 61 67 65 29 29 | 3b 0d 09 09 6f 73 45 76 |essage))|;...osEv|
|000054a0| 65 6e 74 3a 0d 09 09 09 | 43 41 53 45 20 42 53 52 |ent:....|CASE BSR|
|000054b0| 28 65 76 65 6e 74 2e 6d | 65 73 73 61 67 65 2c 20 |(event.m|essage, |
|000054c0| 32 34 29 20 4f 46 09 7b | 68 69 67 68 20 62 79 74 |24) OF.{|high byt|
|000054d0| 65 20 6f 66 20 6d 65 73 | 73 61 67 65 7d 0d 09 09 |e of mes|sage}...|
|000054e0| 09 09 73 75 73 70 65 6e | 64 52 65 73 75 6d 65 4d |..suspen|dResumeM|
|000054f0| 65 73 73 61 67 65 3a 20 | 42 45 47 49 4e 0d 09 09 |essage: |BEGIN...|
|00005500| 09 09 09 67 49 6e 42 61 | 63 6b 67 72 6f 75 6e 64 |...gInBa|ckground|
|00005510| 20 3a 3d 20 42 41 6e 64 | 28 65 76 65 6e 74 2e 6d | := BAnd|(event.m|
|00005520| 65 73 73 61 67 65 2c 20 | 72 65 73 75 6d 65 4d 61 |essage, |resumeMa|
|00005530| 73 6b 29 20 3d 20 30 3b | 0d 09 09 09 09 09 44 6f |sk) = 0;|......Do|
|00005540| 41 63 74 69 76 61 74 65 | 28 46 72 6f 6e 74 57 69 |Activate|(FrontWi|
|00005550| 6e 64 6f 77 2c 20 4e 4f | 54 20 67 49 6e 42 61 63 |ndow, NO|T gInBac|
|00005560| 6b 67 72 6f 75 6e 64 29 | 3b 0d 09 09 09 09 45 4e |kground)|;.....EN|
|00005570| 44 3b 0d 09 09 09 45 4e | 44 3b 0d 09 45 4e 44 3b |D;....EN|D;..END;|
|00005580| 0d 45 4e 44 3b 20 7b 44 | 6f 45 76 65 6e 74 7d 0d |.END; {D|oEvent}.|
|00005590| 0d 0d 7b 24 53 20 4d 61 | 69 6e 7d 0d 50 52 4f 43 |..{$S Ma|in}.PROC|
|000055a0| 45 44 55 52 45 20 45 76 | 65 6e 74 4c 6f 6f 70 3b |EDURE Ev|entLoop;|
|000055b0| 0d 0d 7b 47 65 74 20 65 | 76 65 6e 74 73 20 66 6f |..{Get e|vents fo|
|000055c0| 72 65 76 65 72 2c 20 61 | 6e 64 20 68 61 6e 64 6c |rever, a|nd handl|
|000055d0| 65 20 74 68 65 6d 20 62 | 79 20 63 61 6c 6c 69 6e |e them b|y callin|
|000055e0| 67 20 44 6f 45 76 65 6e | 74 2e 0d 20 47 65 74 20 |g DoEven|t.. Get |
|000055f0| 74 68 65 20 65 76 65 6e | 74 73 20 62 79 20 63 61 |the even|ts by ca|
|00005600| 6c 6c 69 6e 67 20 57 61 | 69 74 4e 65 78 74 45 76 |lling Wa|itNextEv|
|00005610| 65 6e 74 2c 20 69 66 20 | 69 74 27 73 20 61 76 61 |ent, if |it's ava|
|00005620| 69 6c 61 62 6c 65 2c 20 | 6f 74 68 65 72 77 69 73 |ilable, |otherwis|
|00005630| 65 0d 20 62 79 20 63 61 | 6c 6c 69 6e 67 20 47 65 |e. by ca|lling Ge|
|00005640| 74 4e 65 78 74 45 76 65 | 6e 74 2e 20 41 6c 73 6f |tNextEve|nt. Also|
|00005650| 20 63 61 6c 6c 20 41 64 | 6a 75 73 74 43 75 72 73 | call Ad|justCurs|
|00005660| 6f 72 20 65 61 63 68 20 | 74 69 6d 65 20 74 68 72 |or each |time thr|
|00005670| 6f 75 67 68 20 74 68 65 | 20 6c 6f 6f 70 2e 7d 0d |ough the| loop.}.|
|00005680| 0d 56 41 52 0d 09 63 75 | 72 73 6f 72 52 67 6e 09 |.VAR..cu|rsorRgn.|
|00005690| 3a 20 52 67 6e 48 61 6e | 64 6c 65 3b 0d 09 67 6f |: RgnHan|dle;..go|
|000056a0| 74 45 76 65 6e 74 09 3a | 20 42 4f 4f 4c 45 41 4e |tEvent.:| BOOLEAN|
|000056b0| 3b 0d 09 65 76 65 6e 74 | 09 09 3a 20 45 76 65 6e |;..event|..: Even|
|000056c0| 74 52 65 63 6f 72 64 3b | 0d 0d 42 45 47 49 4e 0d |tRecord;|..BEGIN.|
|000056d0| 09 63 75 72 73 6f 72 52 | 67 6e 20 3a 3d 20 4e 65 |.cursorR|gn := Ne|
|000056e0| 77 52 67 6e 3b 09 09 09 | 7b 77 65 d5 6c 6c 20 70 |wRgn;...|{we.ll p|
|000056f0| 61 73 73 20 57 4e 45 20 | 61 6e 20 65 6d 70 74 79 |ass WNE |an empty|
|00005700| 20 72 65 67 69 6f 6e 20 | 74 68 65 20 31 73 74 20 | region |the 1st |
|00005710| 74 69 6d 65 20 74 68 72 | 75 7d 0d 09 52 45 50 45 |time thr|u}..REPE|
|00005720| 41 54 0d 09 09 49 46 20 | 67 48 61 73 57 61 69 74 |AT...IF |gHasWait|
|00005730| 4e 65 78 74 45 76 65 6e | 74 20 54 48 45 4e 09 7b |NextEven|t THEN.{|
|00005740| 70 75 74 20 75 73 20 27 | 61 73 6c 65 65 70 27 20 |put us '|asleep' |
|00005750| 66 6f 72 65 76 65 72 20 | 75 6e 64 65 72 20 4d 75 |forever |under Mu|
|00005760| 6c 74 69 46 69 6e 64 65 | 72 7d 0d 09 09 09 67 6f |ltiFinde|r}....go|
|00005770| 74 45 76 65 6e 74 20 3a | 3d 20 57 61 69 74 4e 65 |tEvent :|= WaitNe|
|00005780| 78 74 45 76 65 6e 74 28 | 65 76 65 72 79 45 76 65 |xtEvent(|everyEve|
|00005790| 6e 74 2c 20 65 76 65 6e | 74 2c 20 4d 41 58 4c 4f |nt, even|t, MAXLO|
|000057a0| 4e 47 49 4e 54 2c 20 63 | 75 72 73 6f 72 52 67 6e |NGINT, c|ursorRgn|
|000057b0| 29 0d 09 09 45 4c 53 45 | 20 42 45 47 49 4e 0d 09 |)...ELSE| BEGIN..|
|000057c0| 09 09 53 79 73 74 65 6d | 54 61 73 6b 3b 09 09 09 |..System|Task;...|
|000057d0| 09 7b 6d 75 73 74 20 62 | 65 20 63 61 6c 6c 65 64 |.{must b|e called|
|000057e0| 20 69 66 20 75 73 69 6e | 67 20 47 65 74 4e 65 78 | if usin|g GetNex|
|000057f0| 74 45 76 65 6e 74 7d 0d | 09 09 09 67 6f 74 45 76 |tEvent}.|...gotEv|
|00005800| 65 6e 74 20 3a 3d 20 47 | 65 74 4e 65 78 74 45 76 |ent := G|etNextEv|
|00005810| 65 6e 74 28 65 76 65 72 | 79 45 76 65 6e 74 2c 20 |ent(ever|yEvent, |
|00005820| 65 76 65 6e 74 29 3b 0d | 09 09 45 4e 44 3b 0d 09 |event);.|..END;..|
|00005830| 09 49 46 20 67 6f 74 45 | 76 65 6e 74 20 54 48 45 |.IF gotE|vent THE|
|00005840| 4e 20 42 45 47 49 4e 0d | 09 09 09 41 64 6a 75 73 |N BEGIN.|...Adjus|
|00005850| 74 43 75 72 73 6f 72 28 | 65 76 65 6e 74 2e 77 68 |tCursor(|event.wh|
|00005860| 65 72 65 2c 20 63 75 72 | 73 6f 72 52 67 6e 29 3b |ere, cur|sorRgn);|
|00005870| 20 7b 6d 61 6b 65 20 73 | 75 72 65 20 77 65 20 68 | {make s|ure we h|
|00005880| 61 76 65 20 74 68 65 20 | 72 69 67 68 74 20 63 75 |ave the |right cu|
|00005890| 72 73 6f 72 7d 0d 09 09 | 09 44 6f 45 76 65 6e 74 |rsor}...|.DoEvent|
|000058a0| 28 65 76 65 6e 74 29 3b | 0d 09 09 45 4e 44 3b 0d |(event);|...END;.|
|000058b0| 09 09 41 64 6a 75 73 74 | 43 75 72 73 6f 72 28 65 |..Adjust|Cursor(e|
|000058c0| 76 65 6e 74 2e 77 68 65 | 72 65 2c 20 63 75 72 73 |vent.whe|re, curs|
|000058d0| 6f 72 52 67 6e 29 3b 0d | 09 55 4e 54 49 4c 20 46 |orRgn);.|.UNTIL F|
|000058e0| 41 4c 53 45 3b 09 09 09 | 09 09 7b 6c 6f 6f 70 20 |ALSE;...|..{loop |
|000058f0| 66 6f 72 65 76 65 72 3b | 20 77 65 20 71 75 69 74 |forever;| we quit|
|00005900| 20 74 68 72 6f 75 67 68 | 20 61 6e 20 45 78 69 74 | through| an Exit|
|00005910| 54 6f 53 68 65 6c 6c 7d | 0d 45 4e 44 3b 20 7b 45 |ToShell}|.END; {E|
|00005920| 76 65 6e 74 4c 6f 6f 70 | 7d 0d 0d 0d 50 52 4f 43 |ventLoop|}...PROC|
|00005930| 45 44 55 52 45 20 5f 44 | 61 74 61 49 6e 69 74 3b |EDURE _D|ataInit;|
|00005940| 20 45 58 54 45 52 4e 41 | 4c 3b 0d 0d 7b 54 68 69 | EXTERNA|L;..{Thi|
|00005950| 73 20 72 6f 75 74 69 6e | 65 20 69 73 20 70 61 72 |s routin|e is par|
|00005960| 74 20 6f 66 20 74 68 65 | 20 4d 50 57 20 72 75 6e |t of the| MPW run|
|00005970| 74 69 6d 65 20 6c 69 62 | 72 61 72 79 2e 20 54 68 |time lib|rary. Th|
|00005980| 69 73 20 65 78 74 65 72 | 6e 61 6c 0d 20 72 65 66 |is exter|nal. ref|
|00005990| 65 72 65 6e 63 65 20 74 | 6f 20 69 74 20 69 73 20 |erence t|o it is |
|000059a0| 64 6f 6e 65 20 73 6f 20 | 74 68 61 74 20 77 65 20 |done so |that we |
|000059b0| 63 61 6e 20 75 6e 6c 6f | 61 64 20 69 74 73 20 73 |can unlo|ad its s|
|000059c0| 65 67 6d 65 6e 74 2c 20 | 25 41 35 49 6e 69 74 2e |egment, |%A5Init.|
|000059d0| 7d 0d 0d 7b 24 53 20 4d | 61 69 6e 7d 0d 42 45 47 |}..{$S M|ain}.BEG|
|000059e0| 49 4e 0d 09 55 6e 6c 6f | 61 64 53 65 67 28 40 5f |IN..Unlo|adSeg(@_|
|000059f0| 44 61 74 61 49 6e 69 74 | 29 3b 09 7b 6e 6f 74 65 |DataInit|);.{note|
|00005a00| 20 74 68 61 74 20 5f 44 | 61 74 61 49 6e 69 74 20 | that _D|ataInit |
|00005a10| 6d 75 73 74 20 6e 6f 74 | 20 62 65 20 69 6e 20 4d |must not| be in M|
|00005a20| 61 69 6e 21 7d 0d 09 46 | 6f 72 63 65 45 6e 76 69 |ain!}..F|orceEnvi|
|00005a30| 72 6f 6e 73 3b 09 09 09 | 7b 63 68 65 63 6b 20 66 |rons;...|{check f|
|00005a40| 6f 72 20 73 6f 6d 65 20 | 62 61 73 69 63 20 72 65 |or some |basic re|
|00005a50| 71 75 69 72 65 6d 65 6e | 74 73 3b 20 65 78 69 74 |quiremen|ts; exit|
|00005a60| 73 20 69 66 20 6e 6f 74 | 20 6d 65 74 7d 0d 09 4d |s if not| met}..M|
|00005a70| 61 78 41 70 70 6c 5a 6f | 6e 65 3b 09 09 09 7b 65 |axApplZo|ne;...{e|
|00005a80| 78 70 61 6e 64 20 74 68 | 65 20 68 65 61 70 20 73 |xpand th|e heap s|
|00005a90| 6f 20 63 6f 64 65 20 73 | 65 67 6d 65 6e 74 73 20 |o code s|egments |
|00005aa0| 6c 6f 61 64 20 61 74 20 | 74 68 65 20 74 6f 70 7d |load at |the top}|
|00005ab0| 0d 0d 09 49 6e 69 74 69 | 61 6c 69 7a 65 3b 09 09 |...Initi|alize;..|
|00005ac0| 09 09 7b 69 6e 69 74 69 | 61 6c 69 7a 65 20 74 68 |..{initi|alize th|
|00005ad0| 65 20 70 72 6f 67 72 61 | 6d 7d 0d 09 55 6e 6c 6f |e progra|m}..Unlo|
|00005ae0| 61 64 53 65 67 28 40 49 | 6e 69 74 69 61 6c 69 7a |adSeg(@I|nitializ|
|00005af0| 65 29 3b 09 7b 6e 6f 74 | 65 20 74 68 61 74 20 49 |e);.{not|e that I|
|00005b00| 6e 69 74 69 61 6c 69 7a | 65 20 6d 75 73 74 20 6e |nitializ|e must n|
|00005b10| 6f 74 20 62 65 20 69 6e | 20 4d 61 69 6e 21 7d 0d |ot be in| Main!}.|
|00005b20| 0d 09 45 76 65 6e 74 4c | 6f 6f 70 3b 09 09 09 09 |..EventL|oop;....|
|00005b30| 7b 63 61 6c 6c 20 74 68 | 65 20 6d 61 69 6e 20 65 |{call th|e main e|
|00005b40| 76 65 6e 74 20 6c 6f 6f | 70 7d 0d 45 4e 44 2e 0d |vent loo|p}.END..|
|00005b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005b80| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00005b90| 50 6f 72 74 5e 2e 70 6f | 72 74 52 65 63 74 2c 20 |Port^.po|rtRect, |
|00005ba0| 74 65 78 74 48 29 3b 20 | 7b 63 61 6c 6c 20 54 65 |textH); |{call Te|
|00005bb0| 08 53 61 6d 70 6c 65 2e | 70 6d 02 00 00 00 54 45 |.Sample.|pm....TE|
|00005bc0| 58 54 4d 50 53 20 00 00 | 00 00 00 c0 00 00 00 00 |XTMPS ..|........|
|00005bd0| 00 00 54 45 58 54 4d 50 | 53 20 00 00 00 00 00 c0 |..TEXTMP|S ......|
|00005be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005bf0| 00 00 9e 50 4a 30 00 00 | 5a d0 00 00 01 7e 69 6e |...PJ0..|Z....~in|
|00005c00| 64 6f 77 20 4d 67 72 20 | 74 6f 20 65 6e 64 20 75 |dow Mgr |to end u|
|00005c10| 70 64 61 74 65 7d 0d 09 | 09 09 20 20 45 4e 44 3b |pdate}..|.. END;|
|00005c20| 20 7b 6f 66 20 75 70 64 | 61 74 65 45 76 74 7d 0d | {of upd|ateEvt}.|
|00005c30| 0d 09 09 45 4e 44 3b 20 | 7b 6f 66 20 65 76 65 6e |...END; |{of even|
|00005c40| 74 20 43 41 53 45 7d 0d | 0d 09 55 4e 54 49 4c 20 |t CASE}.|..UNTIL |
|00005c50| 64 6f 6e 65 46 6c 61 67 | 3b 0d 20 20 45 4e 44 2e |doneFlag|;. END.|
|00005c60| 0d 46 49 52 4d 20 4e 56 | 00 00 48 e7 20 00 4e ad |.FIRM NV|..H. .N.|
|00005c70| 00 4a 4a 80 67 08 4e ba | e3 28 70 00 60 20 4e ba |.JJ.g.N.|.(p.` N.|
|00005c80| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00005c90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ca0| 00 00 00 00 00 00 00 06 | 00 04 00 27 00 00 01 df |........|...'....|
|00005cb0| 02 30 00 27 00 00 01 df | 02 30 9f 1a b4 19 00 00 |.0.'....|.0......|
|00005cc0| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 01 00 |........|........|
|00005cd0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 2c 39 10 |...L...L|...2.,9.|
|00005ce0| 06 fc 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|00005cf0| 00 0a 03 ed ff ff 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+